Skip to content
This repository was archived by the owner on Jun 19, 2025. It is now read-only.

logging: support JSON output in the default logger - #507

Open
derSascha wants to merge 1 commit into
minio:masterfrom
derSascha:support-json-log-output
Open

logging: support JSON output in the default logger#507
derSascha wants to merge 1 commit into
minio:masterfrom
derSascha:support-json-log-output

Conversation

@derSascha

Copy link
Copy Markdown
Contributor

It would be great if the default logger supports structured JSON output, to process the logs with common log collectors. The slog logging framework supports this out of the box 🎉

This pull-request adds a new format option to the log section of the configuration file, that supports text and JSON based output in the default logger. The text format will be used if no format was specified, making the option backward compatible.

Example config looks like this:

log:
  format: JSON
  error: INFO
  audit: INFO
...

The implementation adds a new LogFormat type and forwards the value to the server. This affects only the default audit and error logger that are logging to STDOUT/STDERR.

What do you think about such feature? Any suggestions are welcome.

Add a new "format" option to the log section of the configuration file,
that supports text and JSON based output in the default logger. The text format
will be used if no format was specified, making the option backward compatible.

Signed-off-by: Sascha Wolke <dersascha@users.noreply.github.com>
@derSascha
derSascha force-pushed the support-json-log-output branch from e0f3497 to f189c28 Compare January 30, 2025 18:15
@harshavardhana
harshavardhana force-pushed the master branch 3 times, most recently from f832434 to 63649d0 Compare May 27, 2025 18:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant