Skip to content

Commit

Permalink
Prevent the debug flag from overriding trace logging (#38791)
Browse files Browse the repository at this point in the history
If the log severity in the config file was set to TRACE, which gets
parsed correctly when setting initial log level, AND teleport is
started with `-d/--debug` the log level was being downgraded from
the more verbose trace level to debug because the comparison was
case sensitive. By changing the comparison to be case insensitive
the more verbose option is now used even when `-d/--debug` is
applied.
  • Loading branch information
rosstimothy authored Feb 29, 2024
1 parent 364b84b commit 4093a82
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/config/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -2002,7 +2002,7 @@ func Configure(clf *CommandLineFlags, cfg *servicecfg.Config, legacyAppFlags boo
log.SetLevel(log.DebugLevel)
cfg.Log.SetLevel(log.DebugLevel)
} else {
if fileConf.Logger.Severity != "trace" {
if strings.ToLower(fileConf.Logger.Severity) != "trace" {
fileConf.Logger.Severity = teleport.DebugLevel
}
}
Expand Down

0 comments on commit 4093a82

Please sign in to comment.