@@ -252,7 +252,6 @@ else if (ex instanceof AsyncRequestTimeoutException) {
252252 protected ModelAndView handleHttpRequestMethodNotSupported (HttpRequestMethodNotSupportedException ex ,
253253 HttpServletRequest request , HttpServletResponse response , @ Nullable Object handler ) throws IOException {
254254
255- pageNotFoundLogger .warn (ex .getMessage ());
256255 String [] supportedMethods = ex .getSupportedMethods ();
257256 if (supportedMethods != null ) {
258257 response .setHeader ("Allow" , StringUtils .arrayToDelimitedString (supportedMethods , ", " ));
@@ -376,9 +375,6 @@ protected ModelAndView handleServletRequestBindingException(ServletRequestBindin
376375 protected ModelAndView handleConversionNotSupported (ConversionNotSupportedException ex ,
377376 HttpServletRequest request , HttpServletResponse response , @ Nullable Object handler ) throws IOException {
378377
379- if (logger .isWarnEnabled ()) {
380- logger .warn ("Failed to convert request element: " + ex );
381- }
382378 sendServerError (ex , request , response );
383379 return new ModelAndView ();
384380 }
@@ -397,9 +393,6 @@ protected ModelAndView handleConversionNotSupported(ConversionNotSupportedExcept
397393 protected ModelAndView handleTypeMismatch (TypeMismatchException ex ,
398394 HttpServletRequest request , HttpServletResponse response , @ Nullable Object handler ) throws IOException {
399395
400- if (logger .isWarnEnabled ()) {
401- logger .warn ("Failed to bind request element: " + ex );
402- }
403396 response .sendError (HttpServletResponse .SC_BAD_REQUEST );
404397 return new ModelAndView ();
405398 }
@@ -420,9 +413,6 @@ protected ModelAndView handleTypeMismatch(TypeMismatchException ex,
420413 protected ModelAndView handleHttpMessageNotReadable (HttpMessageNotReadableException ex ,
421414 HttpServletRequest request , HttpServletResponse response , @ Nullable Object handler ) throws IOException {
422415
423- if (logger .isWarnEnabled ()) {
424- logger .warn ("Failed to read HTTP message: " + ex );
425- }
426416 response .sendError (HttpServletResponse .SC_BAD_REQUEST );
427417 return new ModelAndView ();
428418 }
@@ -444,9 +434,6 @@ protected ModelAndView handleHttpMessageNotReadable(HttpMessageNotReadableExcept
444434 protected ModelAndView handleHttpMessageNotWritable (HttpMessageNotWritableException ex ,
445435 HttpServletRequest request , HttpServletResponse response , @ Nullable Object handler ) throws IOException {
446436
447- if (logger .isWarnEnabled ()) {
448- logger .warn ("Failed to write HTTP message: " + ex );
449- }
450437 sendServerError (ex , request , response );
451438 return new ModelAndView ();
452439 }
@@ -520,6 +507,7 @@ protected ModelAndView handleBindException(BindException ex, HttpServletRequest
520507 protected ModelAndView handleNoHandlerFoundException (NoHandlerFoundException ex ,
521508 HttpServletRequest request , HttpServletResponse response , @ Nullable Object handler ) throws IOException {
522509
510+ pageNotFoundLogger .warn (ex .getMessage ());
523511 response .sendError (HttpServletResponse .SC_NOT_FOUND );
524512 return new ModelAndView ();
525513 }
0 commit comments