diff --git a/config/config.go b/config/config.go index 4f6da0c9f8856..ac242e532c514 100644 --- a/config/config.go +++ b/config/config.go @@ -123,7 +123,6 @@ func NewConfig() *Config { Interval: Duration(10 * time.Second), RoundInterval: true, FlushInterval: Duration(10 * time.Second), - LogFormat: "text", LogfileRotationMaxArchives: 5, }, diff --git a/logger/logger.go b/logger/logger.go index 535f4150b0c9b..c344838c0b667 100644 --- a/logger/logger.go +++ b/logger/logger.go @@ -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 }