mirror of
https://github.com/retailcrm/mg-transport-core.git
synced 2024-11-22 05:06:04 +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{
|
return zapcore.EncoderConfig{
|
||||||
MessageKey: "message",
|
MessageKey: "message",
|
||||||
LevelKey: "level",
|
LevelKey: "level",
|
||||||
TimeKey: "timestamp",
|
TimeKey: "datetime",
|
||||||
NameKey: "logger",
|
NameKey: "logger",
|
||||||
CallerKey: "caller",
|
CallerKey: "caller",
|
||||||
FunctionKey: zapcore.OmitKey,
|
FunctionKey: zapcore.OmitKey,
|
||||||
StacktraceKey: "",
|
StacktraceKey: "",
|
||||||
LineEnding: "\n",
|
LineEnding: "\n",
|
||||||
EncodeLevel: func(level zapcore.Level, encoder zapcore.PrimitiveArrayEncoder) {
|
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) {
|
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,
|
EncodeDuration: zapcore.StringDurationEncoder,
|
||||||
EncodeCaller: func(caller zapcore.EntryCaller, encoder zapcore.PrimitiveArrayEncoder) {
|
EncodeCaller: func(caller zapcore.EntryCaller, encoder zapcore.PrimitiveArrayEncoder) {
|
||||||
@ -85,8 +85,8 @@ func NewZapJSON(debug bool) *zap.Logger {
|
|||||||
func EncoderConfigJSON() zapcore.EncoderConfig {
|
func EncoderConfigJSON() zapcore.EncoderConfig {
|
||||||
return zapcore.EncoderConfig{
|
return zapcore.EncoderConfig{
|
||||||
MessageKey: "message",
|
MessageKey: "message",
|
||||||
LevelKey: "level",
|
LevelKey: "level_name",
|
||||||
TimeKey: "timestamp",
|
TimeKey: "datetime",
|
||||||
NameKey: "logger",
|
NameKey: "logger",
|
||||||
CallerKey: "caller",
|
CallerKey: "caller",
|
||||||
FunctionKey: zapcore.OmitKey,
|
FunctionKey: zapcore.OmitKey,
|
||||||
|
Loading…
Reference in New Issue
Block a user