Skip to content

Commit

Permalink
logging: Caddyfile support for duration_format (#4684)
Browse files Browse the repository at this point in the history
Somehow, this was missed. Oops!
  • Loading branch information
francislavoie authored Apr 7, 2022
1 parent 22d8edb commit 7d22966
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions modules/logging/encoders.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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:
Expand Down

0 comments on commit 7d22966

Please sign in to comment.