For more insight into which exception has been resolved, the thrown exception will be included in the log message accordingly
Comment From: Duckulus
Huge W
Comment From: LucaBarden
The warnLogger is intentionally minimal, and may be used in production for example. At most we could add the Exception message in addition to the Exception name. Logging the full exception is not in scope I'm afraid. You can, however, override the
buildLogMessage
method.
We are using it in production and have searched for issues too long most of the time and would have appreciated if the stacktrace was included, so we could have found production bugs faster.
Also in my opinion, most production environments that use software to better organize their logs, like kibana, dont have any disadvantages in terms of clarity since logged exceptions are shown separately from the log message itself.
Comment From: bclozel
I agree with Rossen's assessment. A large part of the Spring community will be concerned by logs becoming too noisy. I'm sure lots of teams do not use Kibana or similar and will be negatively impacted by this change.
Please update your PR to log the exception message in the default implementation of buildLogMessage
.
Comment From: LucaBarden
Let me know if you had a different style in mind
Comment From: rstoyanchev
Thanks for the updates. Apologies for any confusion, but on closer look, Throwable#toString
already does this, so that's about as far as we can take it. If you want full exception logging, you can override buildLogMessage
.
Note that the Spring MVC Auto-Configuration in Spring Boot makes it easy to replace the ExceptionHandlerExceptionResolver
instance through a WebMvcRegistrations
bean. See the docs on that.