From 7c784c83109ab6c2195419850293898ce66da740 Mon Sep 17 00:00:00 2001 From: Neur0toxine Date: Wed, 17 Apr 2024 11:42:31 +0300 Subject: [PATCH] change format to something like symfony monolog --- core/logger/zap.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/logger/zap.go b/core/logger/zap.go index 52618a1..53d598b 100644 --- a/core/logger/zap.go +++ b/core/logger/zap.go @@ -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,