From 655e6fc1fd08e305c4e957ab89d1c00c0cfefa04 Mon Sep 17 00:00:00 2001 From: Jared Wasinger Date: Tue, 14 Nov 2023 21:22:45 +0800 Subject: [PATCH] fix logfmt time field value formatting --- log/handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/log/handler.go b/log/handler.go index d91d0327d3..243777ca29 100644 --- a/log/handler.go +++ b/log/handler.go @@ -177,7 +177,7 @@ func builtinReplace(_ []string, attr slog.Attr) slog.Attr { switch attr.Key { case slog.TimeKey: if attr.Value.Kind() == slog.KindTime { - return slog.Time("t", attr.Value.Time()) + return slog.Any("t", attr.Value.Time().Format(timeFormat)) } case slog.LevelKey: if l, ok := attr.Value.Any().(slog.Level); ok {