logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tmu...@moneynet.com
Subject Re: Accessing MDC data in Appenders?
Date Tue, 07 Aug 2001 17:16:46 GMT

Ceki,

     Thanks, will I be able to use it like I've shown below? What is an
example? Will it be serializable as well?

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


                                                                                         
                                      
                    Ceki Gülcü                                                         
                                        
                    <cgu@qos.ch>         To:     "LOG4J Users Mailing List" <log4j-user@jakarta.apache.org>
                    
                                         cc:                                             
                                      
                    08/07/2001           Subject:     Re: Accessing MDC data in Appenders?
                                     
                    01:08 PM                                                             
                                      
                    Please                                                               
                                      
                    respond to                                                           
                                      
                    "LOG4J Users                                                         
                                      
                    Mailing List"                                                        
                                      
                                                                                         
                                      
                                                                                         
                                      





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





---------------------------------------------------------------------
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