Removes logrus package and refactors logging messages (#5293)
This fix removes logrus package dependency and refactors the console logging as the only logging mechanism by removing file logging support. It rearranges the log message format and adds stack trace information whenever trace information is not available in the error structure. It also adds `--json` flag support for server logging. When minio server is started with `--json` flag, all log messages are displayed in json format, with no start-up and informational log messages. Fixes #5265 #5220 #5197
This commit is contained in:
@@ -418,6 +418,21 @@ type serverConfigV15 struct {
|
||||
Notify *notifier `json:"notify"`
|
||||
}
|
||||
|
||||
// FileLogger is introduced to workaround the dependency about logrus
|
||||
type FileLogger struct {
|
||||
Enable bool `json:"enable"`
|
||||
Filename string `json:"filename"`
|
||||
}
|
||||
|
||||
// ConsoleLogger is introduced to workaround the dependency about logrus
|
||||
type ConsoleLogger struct {
|
||||
Enable bool `json:"enable"`
|
||||
}
|
||||
|
||||
// Loggers struct is defined with FileLogger and ConsoleLogger
|
||||
// although they are removed from logging logic. They are
|
||||
// kept here just to workaround the dependency migration
|
||||
// code/logic has on them.
|
||||
type loggers struct {
|
||||
sync.RWMutex
|
||||
Console ConsoleLogger `json:"console"`
|
||||
|
||||
Reference in New Issue
Block a user