-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
logging: support JSON output in the default logger
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>
- Loading branch information
Showing
9 changed files
with
146 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright 2025 - MinIO, Inc. All rights reserved. | ||
// Use of this source code is governed by the AGPLv3 | ||
// license that can be found in the LICENSE file. | ||
|
||
package log | ||
|
||
// Format defines a type of different log output formats, | ||
// used by audit and error events if no custom log handler specified. | ||
type Format string | ||
|
||
const ( | ||
// TextFormat creates plain text formatted log message | ||
TextFormat Format = "Text" | ||
|
||
// JSONFormat creates JSON formatted log messages | ||
JSONFormat Format = "JSON" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
|
||
address: 0.0.0.0:7373 | ||
admin: | ||
identity: disabled | ||
|
||
tls: | ||
key: ./private.key | ||
cert: ./public.crt | ||
|
||
cache: | ||
expiry: | ||
any: 5m0s | ||
unused: 30s | ||
offline: 0s | ||
|
||
keystore: | ||
fs: | ||
path: /tmp/kes | ||
|
||
# no log format in this file, use defaults | ||
log: | ||
error: INFO | ||
audit: INFO | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
address: 0.0.0.0:7373 | ||
admin: | ||
identity: disabled | ||
|
||
tls: | ||
key: ./private.key | ||
cert: ./public.crt | ||
|
||
cache: | ||
expiry: | ||
any: 5m0s | ||
unused: 30s | ||
offline: 0s | ||
|
||
keystore: | ||
fs: | ||
path: /tmp/kes | ||
|
||
# use JSON output format | ||
log: | ||
format: JSON | ||
error: INFO | ||
audit: INFO | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters