From cd092e02dca9e159d67b02c3ee52a4fe244a8cd5 Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Thu, 20 Nov 2014 17:53:29 +0000 Subject: [PATCH] Remove unecessary Jackson dependency in trace filter --- .../actuate/trace/WebRequestTraceFilter.java | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/trace/WebRequestTraceFilter.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/trace/WebRequestTraceFilter.java index 5daeeeb424..385f826feb 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/trace/WebRequestTraceFilter.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/trace/WebRequestTraceFilter.java @@ -37,9 +37,6 @@ import org.springframework.web.context.request.RequestAttributes; import org.springframework.web.context.request.ServletRequestAttributes; import org.springframework.web.filter.OncePerRequestFilter; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - /** * Servlet {@link Filter} that logs all requests to a {@link TraceRepository}. * @@ -55,8 +52,6 @@ public class WebRequestTraceFilter extends OncePerRequestFilter implements Order private final TraceRepository traceRepository; - private final ObjectMapper objectMapper = new ObjectMapper(); - private ErrorAttributes errorAttributes; /** @@ -93,16 +88,9 @@ public class WebRequestTraceFilter extends OncePerRequestFilter implements Order this.logger.trace("Processing request " + request.getMethod() + " " + request.getRequestURI()); if (this.dumpRequests) { - try { - @SuppressWarnings("unchecked") - Map headers = (Map) trace - .get("headers"); - this.logger.trace("Headers: " - + this.objectMapper.writeValueAsString(headers)); - } - catch (JsonProcessingException ex) { - throw new IllegalStateException("Cannot create JSON", ex); - } + @SuppressWarnings("unchecked") + Map headers = (Map) trace.get("headers"); + this.logger.trace("Headers: " + headers); } }