From ea4be0d0acee035890a783668eeda305865acc0b Mon Sep 17 00:00:00 2001 From: xeptore <29199390+xeptore@users.noreply.github.com> Date: Wed, 22 Mar 2023 23:55:26 +0330 Subject: [PATCH] fix logger format Signed-off-by: xeptore <29199390+xeptore@users.noreply.github.com> --- ingest/cmd/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ingest/cmd/main.go b/ingest/cmd/main.go index c955799..26d24dc 100644 --- a/ingest/cmd/main.go +++ b/ingest/cmd/main.go @@ -13,7 +13,6 @@ import ( "github.com/joho/godotenv" "github.com/rs/zerolog" - "github.com/rs/zerolog/log" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" @@ -35,7 +34,8 @@ var ( func main() { ctx := context.Background() - log := zerolog.New(log.Output(zerolog.ConsoleWriter{Out: os.Stdout, TimeFormat: time.RFC3339})) + zerolog.TimeFieldFormat = zerolog.TimeFormatUnixMicro + log := zerolog.New(os.Stdout).With().Timestamp().Logger() if err := godotenv.Load(); nil != err { if !errors.Is(err, os.ErrNotExist) {