From 27541b77dcebeffb5331f7288c2f3ac433cccef3 Mon Sep 17 00:00:00 2001 From: Henkes Date: Fri, 31 Jul 2015 13:20:45 -0500 Subject: [PATCH] Report ZuulExceptions through logger in ZuulServletFilter --- .../java/com/netflix/zuul/filters/ZuulServletFilter.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/zuul-core/src/main/java/com/netflix/zuul/filters/ZuulServletFilter.java b/zuul-core/src/main/java/com/netflix/zuul/filters/ZuulServletFilter.java index 682f922e8a..947e3aa51e 100644 --- a/zuul-core/src/main/java/com/netflix/zuul/filters/ZuulServletFilter.java +++ b/zuul-core/src/main/java/com/netflix/zuul/filters/ZuulServletFilter.java @@ -26,6 +26,8 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.mockito.runners.MockitoJUnitRunner; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import javax.servlet.*; import javax.servlet.http.HttpServletRequest; @@ -49,6 +51,8 @@ */ public class ZuulServletFilter implements Filter { + private static Logger LOG = LoggerFactory.getLogger(ZuulServletFilter.class); + private ZuulRunner zuulRunner; public void init(FilterConfig filterConfig) throws ServletException { @@ -109,7 +113,7 @@ void init(HttpServletRequest servletRequest, HttpServletResponse servletResponse void error(ZuulException e) { RequestContext.getCurrentContext().setThrowable(e); zuulRunner.error(); - e.printStackTrace(); + LOG.error(e.getMessage(), e); } public void destroy() {