DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16922>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16922

MDC with SMTPAppender doesn't work

           Summary: MDC with SMTPAppender doesn't work
           Product: Log4j
           Version: 1.2
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Appender
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


We are using the MDC (mapped diagnostic contexts) to log certain
context information from a server in a multiple client environment

Additionally, serious error events are mailed using the SMTP
appender.

We notice that in the generated mails, often the logged events
from the MDC are not correct, they contain log info from different
client sessions.

Looking at the SMTPAppender source, it appears to us that
the appender is not using the MDC at all, but only the NDC.

We created our own SMTPAppender and override the append method.
we have added the following statements:
event.getMDCCopy();
super.append(event);

This seems to do the trick (even though it is said that getMDCCopy();
creates a shallow copy!)

The problem appears in the following environment:
log4J version 1.2.6 (but also tried 1.2.7)
with Weblogic6.1 SP4 on Unix(HP) and WinNT,
consequently we use the weblogic JVM (corresponding with JDK1.3)

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to