From 2d67452128c8d43e52ada4ab73f93eded21b04f7 Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Mon, 25 Aug 2014 17:26:57 +0100 Subject: [PATCH] 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 --- .../org/springframework/boot/context/web/ErrorPageFilter.java | 1 + 1 file changed, 1 insertion(+) diff --git a/spring-boot/src/main/java/org/springframework/boot/context/web/ErrorPageFilter.java b/spring-boot/src/main/java/org/springframework/boot/context/web/ErrorPageFilter.java index f7c23c77bd0..bd387136510 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/web/ErrorPageFilter.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/web/ErrorPageFilter.java @@ -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());