fix: log level
This commit is contained in:
parent
0ba51d62fa
commit
bee86b5ac7
1 changed files with 2 additions and 3 deletions
|
@ -27,16 +27,15 @@ func setupLogger(staticConfiguration *static.Configuration) {
|
|||
// configure log level
|
||||
logLevel := getLogLevel(staticConfiguration)
|
||||
|
||||
zerolog.SetGlobalLevel(logLevel)
|
||||
|
||||
// create logger
|
||||
logCtx := zerolog.New(w).With().Timestamp()
|
||||
if logLevel <= zerolog.DebugLevel {
|
||||
logCtx = logCtx.Caller()
|
||||
}
|
||||
|
||||
log.Logger = logCtx.Logger()
|
||||
log.Logger = logCtx.Logger().Level(logLevel)
|
||||
zerolog.DefaultContextLogger = &log.Logger
|
||||
zerolog.SetGlobalLevel(logLevel)
|
||||
|
||||
// Global logrus replacement (related to lib like go-rancher-metadata, docker, etc.)
|
||||
logrus.StandardLogger().Out = logs.NoLevel(log.Logger, zerolog.DebugLevel)
|
||||
|
|
Loading…
Reference in a new issue