Threads go back into the pool between requests. Would you need something to re-initialize it on new requests?
I would not worry about re-initializing because, we are trying to track the log messages *per request*. So irrespective of whether the threads are sent back to pool between requests, we would be populating the MDC on *every request*, may be in a servlet filter. Something like:
MyServletFilter.doFilter() {
Principal user = httprequest.getUserPrincipal();
String strUser = user.getName();
MDC.put("username", strUser);
}
So irrespective of whether the thread is the same or different one, i will be populating my MDC with the username so that this will be available as long as the request spans.
I guess, your concern would be valid if the thread was sent back to pool when the *current request* is still being processed.
These are just my thoughts with whatever little understanding i have about MDC. Feel free to correct me if i have got this wrong.