We use MDC feature of slf4j/log4j to automatically log the details about user/client that is making the request so we can trace the things happening in the thread. public static void setRequestId(String requestId) { if (requestId != null) { MDC.put("MDC_REQUEST_ID", requestId); } else { MDC.put("MDC_REQUEST_ID", ""); } } public static void setUserInContext(long userId) { MDC.put("MDC_USER_ID", String.valueOf(userId)); } and the log4j appender users <appender name="RFA_ROOT" class="org.apache.log4j.rolling.RollingFileAppender"> <rollingPolicy class="org.apache.log4j.rolling.T...