Skip to content

Commit 6f41180

Browse files
committed
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
1 parent 7e2106b commit 6f41180

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,9 +559,9 @@ private void logResponseStatus(HttpMethod method, URI url, ClientHttpResponse re
559559
}
560560

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

0 commit comments

Comments
 (0)