We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7753380 commit bf938edCopy full SHA for bf938ed
server/log/logger.go
@@ -37,7 +37,11 @@ func getLogLevel() zapcore.Level {
37
func getEncoder() zapcore.Encoder {
38
encoderConfig := zap.NewProductionEncoderConfig()
39
encoderConfig.EncodeTime = func(t time.Time, enc zapcore.PrimitiveArrayEncoder) {
40
- enc.AppendString(t.Local().Format("2006-01-02 15:04:05"))
+ location, err := time.LoadLocation("Asia/Singapore")
41
+ if err != nil {
42
+ location = time.Local
43
+ }
44
+ enc.AppendString(t.In(location).Format("2006-01-02 15:04:05"))
45
}
46
encoderConfig.EncodeLevel = zapcore.CapitalLevelEncoder
47
return zapcore.NewConsoleEncoder(encoderConfig)
0 commit comments