From acf65b13b2c40b7886bc91cf53fc27bfe5aa7fcd Mon Sep 17 00:00:00 2001 From: Marco Maurer Date: Fri, 19 Jan 2024 12:29:24 +0100 Subject: [PATCH] fix: Get rid of the fields in all log outputs --- backend/pkg/util/log.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/pkg/util/log.go b/backend/pkg/util/log.go index 3bf389c06..b95872b50 100644 --- a/backend/pkg/util/log.go +++ b/backend/pkg/util/log.go @@ -23,11 +23,14 @@ func NewLogger(logContext string) zerolog.Logger { case "", logFormatPretty: fallthrough default: - writer = zerolog.ConsoleWriter{Out: os.Stderr} + writer = zerolog.ConsoleWriter{ + Out: os.Stderr, + TimeFormat: zerolog.TimeFieldFormat, + } unknownFormat = true } - logger := zerolog.New(writer).Hook( + logger := zerolog.New(writer).With().Timestamp().Logger().Hook( zerolog.HookFunc(func(e *zerolog.Event, level zerolog.Level, message string) { e.Str("context", logContext) }))