logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Deboy <scott.de...@gmail.com>
Subject Re: [SCL-4] Intercepting LoggingEvent
Date Thu, 25 Nov 2010 15:57:57 GMT
Look at RewriteAppender. I think you
May be able to do what you need with that and a custom RewritePolicy.

Scott

On Nov 25, 2010, at 6:33 AM, Bender Heri <hbender@ergonomics.ch> wrote:

> Write your own Renderer derivation which you can specify in xml  
> configuration (assign to your specific class, see below).
> The Trick is that you pass a custom object to the log calls (the  
> param need not to be a String, it is formally an object):
>      MySpecificLogInfoHolder infos = new MySpecificLogInfoHolder()
>      myLog.info( infos );
> When the log4j framework comes to render (after having checked the  
> levels etc.) it calls your custom renderer where you can render the  
> output string as you like.
> Heri
>
>
>
>> -----Original Message-----
>> From: Mohan.Radhakrishnan [mailto:mohanr@fss.co.in]
>> Sent: Thursday, November 25, 2010 7:46 AM
>> To: log4j-user@logging.apache.org
>> Subject: [SCL-4] Intercepting LoggingEvent
>>
>>
>> I am trying to intercept the LoggingEvent which is an instance of a  
>> custom
>> LoggingEvent created by a library. I have a custom appender and  
>> also a
>> filter but neither seems to be a clean way of extracting specific  
>> custom
>> information for logging.
>>
>> I think there should be a way to log only what I want from the  
>> LoggingEvent
>> by extracting it before the log is written.
>>
>> Is this feasible ?
>> --
>> View this message in context: http://old.nabble.com/Intercepting-LoggingEvent-
>> tp30302884p30302884.html
>> Sent from the Log4j - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>

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


Mime
View raw message