Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removing some noise from the logs

  • Loading branch information...
commit 796f61ee379f507031190a5e4fe15f404d434c09 1 parent 4de65e0
@joakime joakime authored
View
6 jetty-slf4j-mdc-handler/src/main/java/org/eclipse/jetty/examples/logging/MDCHandler.java
@@ -8,27 +8,21 @@
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.handler.HandlerWrapper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
public class MDCHandler extends HandlerWrapper
{
- private static final Logger LOG = LoggerFactory.getLogger(MDCHandler.class);
-
@Override
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{
try
{
- LOG.info("Start");
MDC.put("host",request.getServerName());
super.handle(target,baseRequest,request,response);
}
finally
{
MDC.clear();
- LOG.info("Finally");
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.