Skip to content

Commit

Permalink
fix(cloudrequestlog): match grpc status when logging 504
Browse files Browse the repository at this point in the history
  • Loading branch information
ericwenn committed Nov 19, 2021
1 parent c63bfa9 commit c255be3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cloudrequestlog/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ func (l *Middleware) statusToLevel(status int) zapcore.Level {
return zap.DebugLevel
case http.StatusBadRequest <= status && status < http.StatusInternalServerError:
return zap.WarnLevel
case status == http.StatusGatewayTimeout:
// special case for 504 (timeout) to match severity for gRPC status codes
return zap.WarnLevel
default:
return zap.ErrorLevel
}
Expand Down

0 comments on commit c255be3

Please sign in to comment.