Merge pull request #9586 from ellemouton/logConfig
config: only create a sub-log manager if one doesnt already exist
This commit is contained in:
1 file changed
+9
-3
@@ -1416,9 +1416,15 @@ func ValidateConfig(cfg Config, interceptor signal.Interceptor, fileParser,
|
|||||||
return nil, mkErr("error validating logging config: %w", err)
|
return nil, mkErr("error validating logging config: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
cfg.SubLogMgr = build.NewSubLoggerManager(build.NewDefaultLogHandlers(
|
// If a sub-log manager was not already created, then we'll create one
|
||||||
cfg.LogConfig, cfg.LogRotator,
|
// now using the default log handlers.
|
||||||
)...)
|
if cfg.SubLogMgr == nil {
|
||||||
|
cfg.SubLogMgr = build.NewSubLoggerManager(
|
||||||
|
build.NewDefaultLogHandlers(
|
||||||
|
cfg.LogConfig, cfg.LogRotator,
|
||||||
|
)...,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
// Initialize logging at the default logging level.
|
// Initialize logging at the default logging level.
|
||||||
SetupLoggers(cfg.SubLogMgr, interceptor)
|
SetupLoggers(cfg.SubLogMgr, interceptor)
|
||||||
|
|||||||
Reference in new issue
Block a user