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
Spring-Boot: Missing logs on HTTP 500 #488
Comments
Are you using |
I created a minimal application showing the behaviour https://github.com/mindhaq/logbook-logging-demo No |
If you don't handle the exception at all then it will become an error dispatch, i.e. filters are executed a second time with the Error dispatch is a tricky beast to get right, especially with Logbook. See #32, #155 and #334. Past experiences can be best summarized as Don't use ERROR dispatch. Instead I'd suggest to use custom |
Ok, so having an Maybe that should be part of the documentation for the spring-boot integration, it's not so obvious otherwise. |
Yes. But technically it's not so much about how you produce error responses but rather that the ERROR dispatch is not supported.
Yes, it should. |
Ok, got it. Adding an |
When a controller throws an Exception, not all is logged as expected.
Description
When a spring boot controller throws an Exception, resulting in a HTTP 500 which returns (in case of a RestController) details about the error, Logbook logging is not what I would expect.
I'm talking about cases where DispatcherServlet is logging the error like this:
Expected Behavior
Basic configuration: log request and response
With status strategy as below: log request and response
Actual Behavior
Basic configuration: only request gets logged
With status strategy as above: neither request nor response are logged
Steps to Reproduce
Context
I want to log internal server errors including the request and response data.
Your Environment
The text was updated successfully, but these errors were encountered: