From 874ff01ab8c05b3074cf32b69009c4188d53bdb9 Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Wed, 6 Dec 2023 14:52:20 +0700 Subject: [PATCH] cmd/cli: ensure log time field is formated with ms --- cmd/cli/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/cli/main.go b/cmd/cli/main.go index b1287ae..aa166ca 100644 --- a/cmd/cli/main.go +++ b/cmd/cli/main.go @@ -98,6 +98,7 @@ func initConsoleLogging() { // initLogging initializes global logging setup. func initLogging() { + zerolog.TimeFieldFormat = time.RFC3339 + ".000" initLoggingWithBackup(true) } @@ -136,7 +137,7 @@ func initLoggingWithBackup(doBackup bool) { } writers = append(writers, consoleWriter) multi := zerolog.MultiLevelWriter(writers...) - l := mainLog.Load().Output(multi).With().Timestamp().Logger() + l := mainLog.Load().Output(multi).With().Logger() mainLog.Store(&l) // TODO: find a better way. ctrld.ProxyLogger.Store(&l)