Try adding a servlet Filter, which manages the NDC per request:
private static final AtomicLong requestCount = new AtomicLong(0L);
public void doFilter(ServletRequest req, ServletResponse resp,
FilterChain chain) throws ServletException, IOException
{
HttpServletRequest request = (HttpServletRequest) req;
HttpServletResponse response = (HttpServletResponse) resp;
// Retrieve the HttpSession. Create a new one if it does not
exist.
HttpSession session = request.getSession(true);
String sessionId = session.getId();
try {
NDC.push(sessionId + ";" +
requestCount.getAndIncrement());
chain.doFilter(request, response);
}
finally {
log.debug("Finished servicing request.");
NDC.pop();
}
}
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4056171#4056171
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4056171
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user