From bed8c25e4025a2e2a4efc356d8974998c36670f8 Mon Sep 17 00:00:00 2001 From: "IMATIASL\\jaime.pineiro" Date: Fri, 26 Apr 2024 11:40:55 +0200 Subject: [PATCH] feat(logging): Write log time in local timezone rather than UTC --- pkg/modules/logging/logging.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/modules/logging/logging.go b/pkg/modules/logging/logging.go index be3a8e33..d9d80023 100644 --- a/pkg/modules/logging/logging.go +++ b/pkg/modules/logging/logging.go @@ -174,7 +174,7 @@ func newLogEncoder(format string) (zapcore.Encoder, error) { // If interactive terminal, make output more human-readable by default. // Credits: https://github.com/caddyserver/caddy/blob/v2.1.1/logging.go#L671. encCfg.EncodeTime = func(ts time.Time, encoder zapcore.PrimitiveArrayEncoder) { - encoder.AppendString(ts.UTC().Format("2006/01/02 15:04:05.000")) + encoder.AppendString(ts.Local().Format("2006/01/02 15:04:05.000")) } if format == textLoggingFormat || format == autoLoggingFormat {