standardised logging timestamp to ISO8601 (#1625)

Co-authored-by: T <kishore.t@lowes.com>
This commit is contained in:
tkishore1192
2021-06-19 01:22:25 +05:30
committed by GitHub
parent 6c33cf2061
commit 1f0cb3f6f0

View File

@@ -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)
}