/** * Log the request message after the request is processed. * * @param request the http request * @param response the http response */ public void logAfterRequest(HttpServletRequest request, HttpServletResponse response) { StringBuilder message = new StringBuilder(); // Append the log message prefix. message.append(AFTER_REQUEST_LOG_MESSAGE_PREFIX); // Append the URI. message.append("uri=").append(request.getRequestURI()); // Append the query string if present. if (isIncludeQueryString() && StringUtils.hasText(request.getQueryString())) { message.append('?').append(request.getQueryString()); } // Append the HTTP method. message.append(" method=").append(request.getMethod()); // Append the HTTP response status code message.append(" status=").append(response.getStatus()); // Append response time message.append(" responseTimeMillis=").append(System.currentTimeMillis() - requestBeginTimeMillis); // Log the actual message. LOGGER.debug(message.toString()); } }
/** * Log the request message after the request is processed. * * @param request the http request * @param response the http response */ public void logAfterRequest(HttpServletRequest request, HttpServletResponse response) { StringBuilder message = new StringBuilder(); // Append the log message prefix. message.append(AFTER_REQUEST_LOG_MESSAGE_PREFIX); // Append the URI. message.append("uri=").append(request.getRequestURI()); // Append the query string if present. if (isIncludeQueryString() && StringUtils.hasText(request.getQueryString())) { message.append('?').append(request.getQueryString()); } // Append the HTTP method. message.append(" method=").append(request.getMethod()); // Append the HTTP response status code message.append(" status=").append(response.getStatus()); // Append response time message.append(" responseTimeMillis=").append(System.currentTimeMillis() - requestBeginTimeMillis); // Log the actual message. LOGGER.debug(message.toString()); } }
if (isIncludeQueryString() && StringUtils.hasText(request.getQueryString()))
if (isIncludeQueryString() && StringUtils.hasText(request.getQueryString()))