From 124ba1ba714220322c65625012c564f89b75bfc9 Mon Sep 17 00:00:00 2001 From: Francis Lavoie Date: Wed, 14 Jul 2021 13:07:38 -0400 Subject: logging: Prep for `common_log` removal (#4149) See https://github.com/caddyserver/caddy/issues/4148#issuecomment-833207811 --- modules/logging/encoders.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'modules/logging') diff --git a/modules/logging/encoders.go b/modules/logging/encoders.go index 40e86bd..8b2b44c 100644 --- a/modules/logging/encoders.go +++ b/modules/logging/encoders.go @@ -307,6 +307,8 @@ func (lec *LogEncoderConfig) ZapcoreEncoderConfig() zapcore.EncoderConfig { timeFormat = "2006/01/02 15:04:05.000" case "wall_nano": timeFormat = "2006/01/02 15:04:05.000000000" + case "common_log": + timeFormat = "02/Jan/2006:15:04:05 -0700" } timeFormatter = func(ts time.Time, encoder zapcore.PrimitiveArrayEncoder) { encoder.AppendString(ts.UTC().Format(timeFormat)) -- cgit v1.2.3