Commit f4dc090b authored by Phillip Webb's avatar Phillip Webb

Add a little more context to ErrorPageFilter log

Add the servlet and context path along with the exception message to
the error logged in ErrorPageFilter.

See gh-1427
parent 2d674521
...@@ -143,7 +143,12 @@ class ErrorPageFilter extends AbstractConfigurableEmbeddedServletContainer imple ...@@ -143,7 +143,12 @@ class ErrorPageFilter extends AbstractConfigurableEmbeddedServletContainer imple
rethrow(ex); rethrow(ex);
return; return;
} }
logger.error("Forwarding to error page", ex); if (logger.isErrorEnabled()) {
String message = "Forwarding to error page from request ["
+ request.getServletPath() + request.getPathInfo()
+ "] due to exception [" + ex.getMessage() + "]";
logger.error(message, ex);
}
setErrorAttributes(request, 500, ex.getMessage()); setErrorAttributes(request, 500, ex.getMessage());
request.setAttribute(ERROR_EXCEPTION, ex); request.setAttribute(ERROR_EXCEPTION, ex);
request.setAttribute(ERROR_EXCEPTION_TYPE, type.getName()); request.setAttribute(ERROR_EXCEPTION_TYPE, type.getName());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment