Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Before the change the warn logger was not enabled for DefaultHandlerExceptionResolver and it only logged on warn level in case the exception was one of ConversionNotSupportedException, TypeMismatchException, HttpMessageNotReadableException, HttpMessageNotWritableException.
With the latest changes from #21916 the DefaultHandlerExceptionResolver warn logger got enabled by default in the constructor and can't be disabled (setting to null in Configuration class causes NPE). This leads to the state that all resolved exceptions are logged at warn level in AbstractHandlerExceptionResolver logException method. So not only the exceptions mentioned above but also HttpRequestMethodNotSupportedException, HttpMediaTypeNotSupportedException, HttpMediaTypeNotAcceptableException, MissingPathVariableException, MissingServletRequestParameterException, ServletRequestBindingException, MethodArgumentNotValidException, MissingServletRequestPartException, BindException, NoHandlerFoundException.
Can you please clarify what is the logging behavior of DefaultHandlerExceptionResolver?
In my opinion warn logging in this class should also be configurable and not enabled by default. So that developers are free to choose whether they want to have it disabled or enabled. As a side note: it should also honor the application property spring.mvc.log-resolved-exception