Skip to content

Commit

Permalink
iso8601: use yyyy-mm-dd in log timestamps instead of dd-mm-yyyy
Browse files Browse the repository at this point in the history
  • Loading branch information
mmetc committed Oct 25, 2023
1 parent d2d788c commit f4e9f69
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/crowdsec-cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ var (

func main() {
// set the formatter asap and worry about level later
logFormatter := &log.TextFormatter{TimestampFormat: "02-01-2006 15:04:05", FullTimestamp: true}
logFormatter := &log.TextFormatter{TimestampFormat: "2006-01-02 15:04:05", FullTimestamp: true}
log.SetFormatter(logFormatter)

if err := fflag.RegisterAllFeatures(); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/types/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func SetDefaultLoggerConfig(cfgMode string, cfgFolder string, cfgLevel log.Level
}
logLevel = cfgLevel
log.SetLevel(logLevel)
logFormatter = &log.TextFormatter{TimestampFormat: "02-01-2006 15:04:05", FullTimestamp: true, ForceColors: forceColors}
logFormatter = &log.TextFormatter{TimestampFormat: "2006-01-02 15:04:05", FullTimestamp: true, ForceColors: forceColors}
log.SetFormatter(logFormatter)
return nil
}
Expand Down

0 comments on commit f4e9f69

Please sign in to comment.