Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-13596

Inappropriate warn logging in AbstractHandlerExceptionResolver (e.g. for 404 status)

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 4.2.1, 4.2.2
    • Fix Version/s: 4.2.3
    • Component/s: Web
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      In the AbstractHandlerExceptionResolver the log level for all responses handled by the resolveException method is set to WARN, in bold below. The problem is that not all responses handled by the method are responses that should be treated at the WARN log level, as normal responses to the end user can be handled by this method.

      The log level should be reduced to DEBUG.

      	@Override
      	public ModelAndView resolveException(HttpServletRequest request, HttpServletResponse response,
      			Object handler, Exception ex) {
      
      		if (shouldApplyTo(request, handler)) {
      			// Log exception at debug log level
      			if (this.logger.isDebugEnabled()) {
      				this.logger.debug("Resolving exception from handler [" + handler + "]: " + ex);
      			}
      			prepareResponse(ex, response);
      			ModelAndView mav = doResolveException(request, response, handler, ex);
      			if (mav != null) {
      				// Log exception message at warn log level
      				logException(ex, request);
      			}
      			return mav;
      		}
      		else {
      			return null;
      		}
      	}
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sdeleuze Sébastien Deleuze
                Reporter:
                jkylberg Jakob Kylberg
                Last updater:
                Stéphane Nicoll
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  3 years, 3 weeks, 2 days ago