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

Consistent warn logging for handled exceptions [SPR-17178] #21714

Closed
spring-issuemaster opened this issue Aug 14, 2018 · 4 comments

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster commented Aug 14, 2018

Ran Cohen opened SPR-17178 and commented

I had a controller, and a field in the controller marked as Long. I tried using a url with the field being 0.88, and nothing happend.

After extensive debug, I found a Bind exception, and the reason I thought nothing happend is that the class RequestMappingHandlerAdapter in the method invokeHandlerMethod has a try... finally, no catch.

I wasted a few hours trying to figure out what happend.

Please fix it.


Affects: 4.3.14

Issue Links:

  • #21916 ExceptionHandlerExceptionResolver started to log on WARN level
  • #21932 AbstractHandlerExceptionResolver logs handled exceptions at WARN

Referenced from: commits 8e980d9, 41e6aa6, a409233, bf7fa39, 04141de, 6ea3441, de453ac

Backported to: 4.3.19

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Aug 14, 2018

Juergen Hoeller commented

This is intentional: Exceptions are being propagated to the DispatcherServlet level from there, to be processed by a HandlerExceptionResolver or ultimately propagated to the Servlet container (similar to a regular servlet throwing an exception). I wonder why your bind exception didn't show up in those places?

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Aug 14, 2018

Ran Cohen commented

I don't know if that was the problem, but my log level was info, not debug, so I didn't see the exception. 

Exceptions like this should at least be in a warning log, not debug I think.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Aug 14, 2018

Juergen Hoeller commented

Rossen Stoyanchev, what's your take on this? Some of the cases in DefaultHandlerExceptionResolver indeed only lead to a particular HTTP response but not easily noticeable logging on the server side... We have a few warn log cases there already, do we need to cover further ground with those?

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Aug 15, 2018

Rossen Stoyanchev commented

I'd expect a response with status 400? In other words the exception was probably handled. That said we do need to ensure consistent warn log messages in DefaultHandlerExceptionResolver..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.