Skip to content

Commit

Permalink
standardised logging timestamp to ISO8601 (#1625)
Browse files Browse the repository at this point in the history
Co-authored-by: T <[email protected]>
  • Loading branch information
tkishore1192 and T authored Jun 18, 2021
1 parent 6c33cf2 commit 1f0cb3f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/logging/simple_logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,14 @@ type StructuredLogger struct {
func NewStructuredLoggerFromLevel(lvl LogLevel) (SimpleLogging, error) {
cfg := zap.NewProductionConfig()

cfg.EncoderConfig.EncodeTime = zapcore.ISO8601TimeEncoder
cfg.Level = zap.NewAtomicLevelAt(lvl.zLevel)
return newStructuredLogger(cfg)
}

func NewStructuredLogger() (SimpleLogging, error) {
cfg := zap.NewProductionConfig()
cfg.EncoderConfig.EncodeTime = zapcore.ISO8601TimeEncoder
return newStructuredLogger(cfg)
}

Expand Down

0 comments on commit 1f0cb3f

Please sign in to comment.