Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AsyncRestTemplate logging too verbose #28049

Closed
flozano opened this issue Feb 14, 2022 · 1 comment
Closed

AsyncRestTemplate logging too verbose #28049

flozano opened this issue Feb 14, 2022 · 1 comment
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@flozano
Copy link

flozano commented Feb 14, 2022

This log is really too verbose, not all 4xx are error conditions, many REST apis will return perfectly expected 4xx (eg: checking if a given resource exists) and yielding a warning is too much:

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

I'm aware AsyncRestTemplate is deprecated and gone from 6.0, so this only affects 5.3.x and older... and I'm also on the way to remove it from my code, but we still have a significant amount of code using it and this issue has bothered us forever. As it's trivial to fix, I decided to log it here just in case you want to consider it.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Feb 14, 2022
@bclozel bclozel added in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Feb 14, 2022
@bclozel bclozel added this to the 5.3.17 milestone Feb 18, 2022
@bclozel bclozel self-assigned this Feb 18, 2022
@flozano
Copy link
Author

flozano commented Feb 28, 2022

thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants