Skip to content

Commit

Permalink
reverseproxy: Log error at error level (fix #4360)
Browse files Browse the repository at this point in the history
  • Loading branch information
mholt committed Sep 25, 2021
1 parent 16f7521 commit 3336faf
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions modules/caddyhttp/reverseproxy/reverseproxy.go
Expand Up @@ -574,12 +574,11 @@ func (h *Handler) reverseProxy(rw http.ResponseWriter, req *http.Request, repl *
duration := time.Since(start)
logger := h.logger.With(
zap.String("upstream", di.Upstream.String()),
zap.Duration("duration", duration),
zap.Object("request", caddyhttp.LoggableHTTPRequest{Request: req}),
)
if err != nil {
logger.Debug("upstream roundtrip",
zap.Duration("duration", duration),
zap.Error(err))
logger.Error("upstream roundtrip", zap.Error(err))
return err
}
logger.Debug("upstream roundtrip",
Expand Down

0 comments on commit 3336faf

Please sign in to comment.