mirror of
https://github.com/retailcrm/mg-transport-core.git
synced 2024-11-21 12:46:03 +03:00
change format to something like symfony monolog
This commit is contained in:
parent
f6c319752e
commit
7c784c8310
@ -42,17 +42,17 @@ func EncoderConfigConsole() zapcore.EncoderConfig {
|
||||
return zapcore.EncoderConfig{
|
||||
MessageKey: "message",
|
||||
LevelKey: "level",
|
||||
TimeKey: "timestamp",
|
||||
TimeKey: "datetime",
|
||||
NameKey: "logger",
|
||||
CallerKey: "caller",
|
||||
FunctionKey: zapcore.OmitKey,
|
||||
StacktraceKey: "",
|
||||
LineEnding: "\n",
|
||||
EncodeLevel: func(level zapcore.Level, encoder zapcore.PrimitiveArrayEncoder) {
|
||||
encoder.AppendString("level=" + level.CapitalString())
|
||||
encoder.AppendString("level_name=" + level.CapitalString())
|
||||
},
|
||||
EncodeTime: func(t time.Time, encoder zapcore.PrimitiveArrayEncoder) {
|
||||
encoder.AppendString("time=" + t.Format(time.RFC3339))
|
||||
encoder.AppendString("datetime=" + t.Format(time.RFC3339))
|
||||
},
|
||||
EncodeDuration: zapcore.StringDurationEncoder,
|
||||
EncodeCaller: func(caller zapcore.EntryCaller, encoder zapcore.PrimitiveArrayEncoder) {
|
||||
@ -85,8 +85,8 @@ func NewZapJSON(debug bool) *zap.Logger {
|
||||
func EncoderConfigJSON() zapcore.EncoderConfig {
|
||||
return zapcore.EncoderConfig{
|
||||
MessageKey: "message",
|
||||
LevelKey: "level",
|
||||
TimeKey: "timestamp",
|
||||
LevelKey: "level_name",
|
||||
TimeKey: "datetime",
|
||||
NameKey: "logger",
|
||||
CallerKey: "caller",
|
||||
FunctionKey: zapcore.OmitKey,
|
||||
|
Loading…
Reference in New Issue
Block a user