From d78a8d4828c410d96f429ed223dacf444e9e6974 Mon Sep 17 00:00:00 2001 From: VictorTrustyDev Date: Wed, 27 Sep 2023 00:25:44 +0700 Subject: [PATCH] use UTC time for logger --- logging/default_logger.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/logging/default_logger.go b/logging/default_logger.go index 40f4b33..07a6d89 100644 --- a/logging/default_logger.go +++ b/logging/default_logger.go @@ -4,6 +4,7 @@ import ( "fmt" logtypes "github.com/EscanBE/go-lib/logging/types" "os" + "time" "github.com/rs/zerolog" "github.com/rs/zerolog/log" @@ -20,6 +21,9 @@ type defaultLogger struct { // NewDefaultLogger builds a new defaultLogger instance func NewDefaultLogger() Logger { + zerolog.TimestampFunc = func() time.Time { + return time.Now().UTC() + } result := &defaultLogger{ Logger: log.Logger, }