Skip to content

Commit

Permalink
Merge pull request #14146 from SimFG/parse_config
Browse files Browse the repository at this point in the history
config: Add the default case when failing to parse the log rotate config json
  • Loading branch information
ahrtr committed Jun 23, 2022
2 parents 1da0b01 + 1dcd75f commit 33ba538
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/embed/config_logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ func setupLogRotation(logOutputs []string, logRotateConfigJSON string) error {
return fmt.Errorf("improperly formatted log rotation config: %v", err)
case errors.As(err, &unmarshalTypeError):
return fmt.Errorf("invalid log rotation config: %v", err)
default:
return fmt.Errorf("fail to unmarshal log rotation config: %v", err)
}
}
zap.RegisterSink("rotate", func(u *url.URL) (zap.Sink, error) {
Expand Down

0 comments on commit 33ba538

Please sign in to comment.