SUSE / telemetry-server

Proof of Concept Telemetry Server scaffolding
Apache License 2.0
2 stars 0 forks source link

Switch to log/slog structured logging #23

Closed rtamalin closed 2 months ago

rtamalin commented 2 months ago

Using slog allows use to log messages at different log levels, and only those messages whose level is at or above the active log level will be emitted.

Add basic log management capabilities to which can be configured via the new logging section in the config file.

The default settings will log info level messages to stderr using the Text var=value format. Also available is the JSON for object format. The syslog like format is not implemented yet.

The config file settings will supersede the default logger once the config has been loaded and the telemetry server app has been setup.

Added a new --debug option which forces the active log level to debug, overriding whatever is specified in the config.

Updated a number of code paths to uses slog, including the methods of AppRequest, which now sets up a customer logger that includes the request method and URL values in all messages that it emits.

Minor cleanup of report staging data base interactions to use the row id field rather than the reportId field for certain operations.

Outstanding work items for follow on PRs:

Relates: #10