fix(logger): Avoid setting the log-format default too early (#16108)
This commit is contained in:
parent
f8b2b0a914
commit
5793ff6366
|
|
@ -123,7 +123,6 @@ func NewConfig() *Config {
|
|||
Interval: Duration(10 * time.Second),
|
||||
RoundInterval: true,
|
||||
FlushInterval: Duration(10 * time.Second),
|
||||
LogFormat: "text",
|
||||
LogfileRotationMaxArchives: 5,
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -227,6 +227,10 @@ func SetupLogging(cfg *Config) error {
|
|||
return fmt.Errorf("invalid deprecated 'logtarget' setting %q", cfg.LogTarget)
|
||||
}
|
||||
|
||||
if cfg.LogFormat == "" {
|
||||
cfg.LogFormat = "text"
|
||||
}
|
||||
|
||||
if cfg.Debug {
|
||||
cfg.logLevel = telegraf.Debug
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue