Skip to content

Commit 1760e7b

Browse files
authored
Log 400 errors in addition to 500 errors (#3832)
1 parent 9d3e08d commit 1760e7b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/util/http.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ func (l Log) Wrap(next http.Handler) http.Handler {
219219
n, err := next(p)
220220
headerWritten = true
221221
httpErr.Add(err)
222-
if httpCode >= 500 && httpCode < 600 {
222+
if httpCode >= 400 && httpCode < 600 {
223223
bodyLeft = captureResponseBody(p, bodyLeft, &buf)
224224
}
225225
return n, err
@@ -267,7 +267,8 @@ func (l Log) Wrap(next http.Handler) http.Handler {
267267

268268
return
269269
}
270-
if 100 <= statusCode && statusCode < 500 {
270+
271+
if 100 <= statusCode && statusCode < 400 {
271272
if l.LogRequestAtInfoLevel {
272273
level.Info(requestLogD).Log("msg", "http request processed")
273274
} else {

0 commit comments

Comments
 (0)