Browse Source

Align AsyncRestTemplate error logging with RestTemplate

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
pull/28119/head
Brian Clozel 4 years ago
parent
commit
6f41180cc5
  1. 4
      spring-web/src/main/java/org/springframework/web/client/AsyncRestTemplate.java

4
spring-web/src/main/java/org/springframework/web/client/AsyncRestTemplate.java

@ -559,9 +559,9 @@ public class AsyncRestTemplate extends org.springframework.http.client.support.I @@ -559,9 +559,9 @@ public class AsyncRestTemplate extends org.springframework.http.client.support.I
}
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) {

Loading…
Cancel
Save