/** * Handles this context with handlers. */ public void handle() { try { for (handleIndex++; handleIndex < handlers.size(); handleIndex++) { handlers.get(handleIndex).handle(this); } } catch (final Exception e) { final String requestLog = Requests.getLog(request); LOGGER.log(Level.ERROR, "Handler process failed: " + requestLog, e); setRenderer(new Http500Renderer(e)); } }
/** * Logs the specified request with the specified level and logger. * <p> * Logging information of the specified request includes: * <ul> * <li>method</li> * <li>URL</li> * <li>content type</li> * <li>character encoding</li> * <li>local (address, port, name)</li> * <li>remote (address, port, host)</li> * <li>headers</li> * </ul> * * @param httpServletRequest the specified HTTP servlet request * @param level the specified logging level * @param logger the specified logger */ public static void log(final HttpServletRequest httpServletRequest, final Level level, final Logger logger) { if (!logger.isLoggable(level)) { return; } logger.log(level, getLog(httpServletRequest)); }
final String requestLog = Requests.getLog(request); LOGGER.log(Level.ERROR, "Renders template [" + templateName + "] failed [" + requestLog + "]", e);
/** * nextHandler. */ public void nextHandler() { if (ihandlerIterable.hasNext()) { try { ihandlerIterable.next().handle(httpRequestContext, this); } catch (final Exception e) { final HttpServletRequest request = httpRequestContext.getRequest(); final String log = Requests.getLog(request); LOGGER.log(Level.ERROR, log + " processing failed ", e); } } } }
/** * Logs the specified request with the specified level and logger. * <p> * Logging information of the specified request includes: * <ul> * <li>method</li> * <li>URL</li> * <li>content type</li> * <li>character encoding</li> * <li>local (address, port, name)</li> * <li>remote (address, port, host)</li> * <li>headers</li> * </ul> * * @param httpServletRequest the specified HTTP servlet request * @param level the specified logging level * @param logger the specified logger */ public static void log(final HttpServletRequest httpServletRequest, final Level level, final Logger logger) { if (!logger.isLoggable(level)) { return; } logger.log(level, getLog(httpServletRequest)); }
final String requestLog = Requests.getLog(request); LOGGER.log(Level.ERROR, "Renders template [" + templateName + "] failed [" + requestLog + "]", e);