Browse Source

Log exceptions in ErrorPageFilter

For some reason I thought that the DispatcherServlet default handler
would log all exceptions, so if we did it in the ErrorPageFilter it
would lead to duplicates. That appears not to be the case.

Fixes gh-1427
pull/1487/merge
Dave Syer 12 years ago
parent
commit
2d67452128
  1. 1
      spring-boot/src/main/java/org/springframework/boot/context/web/ErrorPageFilter.java

1
spring-boot/src/main/java/org/springframework/boot/context/web/ErrorPageFilter.java

@ -143,6 +143,7 @@ class ErrorPageFilter extends AbstractConfigurableEmbeddedServletContainer imple @@ -143,6 +143,7 @@ class ErrorPageFilter extends AbstractConfigurableEmbeddedServletContainer imple
rethrow(ex);
return;
}
logger.error("Forwarding to error page", ex);
setErrorAttributes(request, 500, ex.getMessage());
request.setAttribute(ERROR_EXCEPTION, ex);
request.setAttribute(ERROR_EXCEPTION_TYPE, type.getName());

Loading…
Cancel
Save