Home

Niklas Gawell
There is a newer version of this page. You can find it here.

Request tracing in jersey:

  • Add the following annotation to your resources:
    @ResourceFilters({ServletRequestTraceIdFilter.class})
  • Use the se.gawell.setrace.jersey.RequestTracingJerseyClient rather than Client from jersey
  • Add %X{requestTraceId} to your log4j.xml. Example:

    <appender name="CONSOLE" class="">
    <layout class="">
    <param name="ConversionPattern" value="&lt;a class=" alink="" notfound"="" href="%25d%7Bdd/MM/yy%20hh%3Amm%3Ass%3Asss%20z%7D">%d{dd/MM/yy hh\:mm:ss:sss z} %X{requestTraceId} %5p %c{2}: %m%n" />
    </layout>
    </appender>


MongoDB Logo MongoDB