logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gülcü <...@qos.ch>
Subject Re: Accessing MDC data in Appenders?
Date Tue, 07 Aug 2001 17:08:04 GMT

Tim,

It will be a standard field LoggingEvent in the next few days. Regards, Ceki

At 12:19 07.08.2001 -0400, you wrote:
>Everyone,
>
>     Are MDC's associated or stored with LoggingEvents? I need to create a
>custom appender and I was hoping I could do the following:
>
>// Set some custom fields to log
>MDC.put("user", "joe");
>MDC.put("id", "123");
>
>cat.debug("User info: ");
>
>
>// In custom appender class..bogus code for now..just an example
>
>append(LoggingEvent evt) {
>
>     System.out.println("user: " + evt.getMDC().get("user"));
>     System.out.println("id: " + evt.getMDC().get("id"));
>
>}
>
>Is this possible? Or do I have still have to create custom LoggingEvent
>class that have the fields I want?
>
>Thanks,
>- Tim
>
>____________________________________________________
>Timothy G. Mullé
>Senior Software Architect
>Reuters Valley Forge Solutions Center
>1000 Madison Avenue
>Norristown, PA 19403-2432
>
>Phone: (610) 650-8600 x8340
>Fax:      (610) 650-8170
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-user-help@jakarta.apache.org

--
Ceki Gülcü - http://qos.ch


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


Mime
View raw message