logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rodriguez, Victor" <vrodrig...@Intrado.com>
Subject RE: URGENT: Overriding the forcedLog method
Date Fri, 16 Apr 2004 21:57:36 GMT
Oops...I meant custom fields...

-----Original Message-----
From: Rodriguez, Victor [mailto:vrodriguez@intrado.com] 
Sent: Friday, April 16, 2004 15:56
To: Log4J Developers List
Subject: RE: URGENT: Overriding the forcedLog method

No, I haven't considered this option Ceki, but it sounds plausible.

Actually, I think I've figured out another way.  The LoggingEvent has the original Object
that was passed to the LoggingEvent constructor.  In the append method of my custom ElmNTEventLogAppender,
I can call event.getMessage() and get the customer fields there.   Hmmm....

-----Original Message-----
From: Ceki "Gülcü" [mailto:ceki@qos.ch]
Sent: Friday, April 16, 2004 15:13
To: Log4J Developers List
Subject: RE: URGENT: Overriding the forcedLog method

Hello,

Have you given the property field in LoggingEvent (available from CVS head) any consideration?
This should allow you to add your own field to LoggingEvent without needing to sub-class Logger,
etc.

At 10:47 PM 4/16/2004, you wrote:
>I don't think this would work in my case.  Let me elaborate...
>
>I've customized the NTEventLogAppender.dll by adding a new reportEvent 
>method which takes a category and an event id so as to expand on the 
>limited support for windows event log categories and event id's that 
>comes built in to the NTEventLogAppender.dll and 
>org.apache.log4j.nt.NTEventLogAppender class.
>
>To take advantage of this new reportEvent method, I've had to create my 
>own ElmNTEventLogAppender class to call it.  The append method takes a 
>LoggingEvent, so I have to create derive my own ElmLoggingEvent class 
>to contain the new nt_category and nt_event_id attributes.  The 
>LoggingEvent gets created in the forcedLog method of the Logger class.
>So that's why I have to derive my own Logger to override the forcedLog 
>method to create an ElmLoggingEvent object instead of the standard 
>LoggingEvent object.

--
Ceki Gülcü

      For log4j documentation consider "The complete log4j manual"
      ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp  



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



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



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


Mime
View raw message