Skip to content

Commit

Permalink
Exempt 503 (Service Unavailable) from error logging (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusv authored and bboreham committed Jun 4, 2018
1 parent 90f62a2 commit b6e3b7f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion middleware/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (l Log) Wrap(next http.Handler) http.Handler {
wrapped := newBadResponseLoggingWriter(w, &buf)
next.ServeHTTP(wrapped, r)
statusCode := wrapped.statusCode
if 100 <= statusCode && statusCode < 500 || statusCode == 502 {
if 100 <= statusCode && statusCode < 500 || statusCode == http.StatusBadGateway || statusCode == http.StatusServiceUnavailable {
logWithRequest(r).Debugf("%s %s (%d) %s", r.Method, uri, statusCode, time.Since(begin))
if l.LogRequestHeaders && headers != nil {
logWithRequest(r).Debugf("Is websocket request: %v\n%s", IsWSHandshakeRequest(r), string(headers))
Expand Down

0 comments on commit b6e3b7f

Please sign in to comment.