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
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user