Log at debug level when configured (#2262)

We added debug/info log levels in #2225 but the configuration was not
actually used to set the level.
This commit is contained in:
Zachary Wasserman 2020-07-21 15:35:57 -07:00 committed by GitHub
parent 7494513400
commit 4023296d86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,6 +71,11 @@ the way that the Fleet server works.
} else {
logger = kitlog.NewLogfmtLogger(output)
}
if config.Logging.Debug {
logger = level.NewFilter(logger, level.AllowDebug())
} else {
logger = level.NewFilter(logger, level.AllowInfo())
}
logger = kitlog.With(logger, "ts", kitlog.DefaultTimestampUTC)
}