chore: Change log ts format to RFC3339 (#1191)
The TimeEncoder for zap seems to have been set to EpochTimeEncoder which is the default and it was not very readable. Changing it to a TimeEncoderOfLayout(time.RFC3339) for readability. Another benefit of doing this is the ts format is now consistent with various timestamps ARC put into pod and other custom resource annotations.
This commit is contained in:
parent
15ee6d6360
commit
301439b06a
|
|
@ -4,6 +4,7 @@ import (
|
|||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/go-logr/logr"
|
||||
zaplib "go.uber.org/zap"
|
||||
|
|
@ -48,6 +49,7 @@ func NewLogger(logLevel string) logr.Logger {
|
|||
atomicLevel := zaplib.NewAtomicLevelAt(level)
|
||||
o.Level = &atomicLevel
|
||||
}
|
||||
o.TimeEncoder = zapcore.TimeEncoderOfLayout(time.RFC3339)
|
||||
})
|
||||
|
||||
return log
|
||||
|
|
|
|||
Loading…
Reference in New Issue