Skip to content

Commit

Permalink
Align AsyncRestTemplate error logging with RestTemplate
Browse files Browse the repository at this point in the history
Prior to this commit, `AsyncRestTemplate` would log errors (including
simple 404s) with WARN level. Such errors are quite common and should
not clutter logs.

This commit aligns the logging strategy with RestTemplate, using the
DEBUG level for such cases.

Fixes gh-28049
  • Loading branch information
bclozel committed Feb 28, 2022
1 parent 7e2106b commit 6f41180
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -559,9 +559,9 @@ private void logResponseStatus(HttpMethod method, URI url, ClientHttpResponse re
}

private void handleResponseError(HttpMethod method, URI url, ClientHttpResponse response) throws IOException {
if (logger.isWarnEnabled()) {
if (logger.isDebugEnabled()) {
try {
logger.warn("Async " + method.name() + " request for \"" + url + "\" resulted in " +
logger.debug("Async " + method.name() + " request for \"" + url + "\" resulted in " +
response.getRawStatusCode() + " (" + response.getStatusText() + "); invoking error handler");
}
catch (IOException ex) {
Expand Down

0 comments on commit 6f41180

Please sign in to comment.