summaryrefslogtreecommitdiffhomepage
path: root/modules/logging
diff options
context:
space:
mode:
authorFrancis Lavoie <[email protected]>2022-04-07 13:23:28 -0400
committerGitHub <[email protected]>2022-04-07 11:23:28 -0600
commit7d229665ed96a6b1e5b89d6fd963ac54e2b56bb6 (patch)
tree0f4fcc462771527bd8ed30d9119f753e884aa714 /modules/logging
parent22d8edb984b9a0cbe5d205f823b455920464bb95 (diff)
downloadcaddy-7d229665ed96a6b1e5b89d6fd963ac54e2b56bb6.tar.gz
caddy-7d229665ed96a6b1e5b89d6fd963ac54e2b56bb6.zip
logging: Caddyfile support for `duration_format` (#4684)
Somehow, this was missed. Oops!
Diffstat (limited to 'modules/logging')
-rw-r--r--modules/logging/encoders.go21
1 files changed, 12 insertions, 9 deletions
diff --git a/modules/logging/encoders.go b/modules/logging/encoders.go
index bc5fe210e..38083db08 100644
--- a/modules/logging/encoders.go
+++ b/modules/logging/encoders.go
@@ -128,15 +128,16 @@ type LogEncoderConfig struct {
// UnmarshalCaddyfile populates the struct from Caddyfile tokens. Syntax:
//
// {
-// message_key <key>
-// level_key <key>
-// time_key <key>
-// name_key <key>
-// caller_key <key>
-// stacktrace_key <key>
-// line_ending <char>
-// time_format <format>
-// level_format <format>
+// message_key <key>
+// level_key <key>
+// time_key <key>
+// name_key <key>
+// caller_key <key>
+// stacktrace_key <key>
+// line_ending <char>
+// time_format <format>
+// duration_format <format>
+// level_format <format>
// }
//
func (lec *LogEncoderConfig) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
@@ -163,6 +164,8 @@ func (lec *LogEncoderConfig) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
lec.LineEnding = &arg
case "time_format":
lec.TimeFormat = arg
+ case "duration_format":
+ lec.DurationFormat = arg
case "level_format":
lec.LevelFormat = arg
default: