Hi,

Servers never guarantees that thread allocated to a request from client would 
be given the same thread on subsequent requests from the client. Hence its 
advisable to clear out the mdc info before the request ends(preferable)or in 
case you wouldn't like to clean up then make sure you overwrite it every time 
to get the correct output.

Hope this helps!!

Cheers!


-----Original Message-----
From: Renan Vinícius Mozone [mailto:renan.moz...@gmail.com]
Sent: Fri 12/4/2009 11:19 PM
To: log4j-user
Subject: Using MDC on an application server with thread pools
 
    On my web application (it uses JSP pages) I'm using the MDC to put the
the sessionid on the log records, but i'm facing a problem. The application
server is IBM WebSphere 6.1 and it uses thread pools. So, sometimes, the
thread for some sessions is changed (the pool allocate another thread to
continue the session) and since the MDC is thread based, in this cases I'm
getting a incorrect session on the log records. The log's are scrambled now.

    Any suggestions?


Information transmitted by this e-mail is proprietary to MphasiS, its 
associated companies and/ or its customers and is intended 
for use only by the individual or entity to which it is addressed, and may 
contain information that is privileged, confidential or 
exempt from disclosure under applicable law. If you are not the intended 
recipient or it appears that this mail has been forwarded 
to you without proper authority, you are notified that any use or dissemination 
of this information in any manner is strictly 
prohibited. In such cases, please notify us immediately at 
mailmas...@mphasis.com and delete this mail from your records.

Reply via email to