mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
zap
This commit is contained in:
parent
5310f60422
commit
b2e4dce77a
@ -85,7 +85,11 @@ func (l *ZapLogger) cores() (zap.Option, error) {
|
||||
c := zap.NewProductionEncoderConfig()
|
||||
c.EncodeTime = zapcore.ISO8601TimeEncoder
|
||||
c.EncodeDuration = zapcore.SecondsDurationEncoder
|
||||
c.EncodeLevel = zapcore.LowercaseColorLevelEncoder
|
||||
c.MessageKey = "msg"
|
||||
c.LevelKey = "level"
|
||||
c.TimeKey = "time"
|
||||
c.CallerKey = "caller"
|
||||
//c.EncodeLevel = zapcore.LowercaseColorLevelEncoder
|
||||
fileEncoder := zapcore.NewJSONEncoder(c)
|
||||
fileEncoder.AddInt("PID", os.Getpid())
|
||||
writer, err := l.getWriter()
|
||||
|
Loading…
x
Reference in New Issue
Block a user