Skip to content

Commit

Permalink
Log 400 errors in addition to 500 errors (#3832)
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanhuhta authored Jan 11, 2025
1 parent 9d3e08d commit 1760e7b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/util/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ func (l Log) Wrap(next http.Handler) http.Handler {
n, err := next(p)
headerWritten = true
httpErr.Add(err)
if httpCode >= 500 && httpCode < 600 {
if httpCode >= 400 && httpCode < 600 {
bodyLeft = captureResponseBody(p, bodyLeft, &buf)
}
return n, err
Expand Down Expand Up @@ -267,7 +267,8 @@ func (l Log) Wrap(next http.Handler) http.Handler {

return
}
if 100 <= statusCode && statusCode < 500 {

if 100 <= statusCode && statusCode < 400 {
if l.LogRequestAtInfoLevel {
level.Info(requestLogD).Log("msg", "http request processed")
} else {
Expand Down

0 comments on commit 1760e7b

Please sign in to comment.