[logback-user] listening on rolling events

yaog yairogen at gmail.com
Thu Nov 17 13:42:50 CET 2011




Hi Ceki,

Thanks. I tried this but the only relevant event I see has this text:

INFO in c.q.l.co.rolling.helper.RenameUtil - Renaming file

As the listener runs in another thread I cannot guarantee that I can do my
work. What I need to do is write a header (a dump of the current application
configuration) and to make sure that in each new file this is the first
thing on the file.

Your solution makes it be somewhere at the beginning of the file but not
necessarily the first thing.

Any other ideas?

Yair


Ceki Gulcu wrote:
> 
> On 16.11.2011 14:47, Yair Ogen wrote:
>> Hi,
>>
>> Is there a way to add a listener to a RollingFileAppender so each time
>> it rolls I can run some code in a call back function?
> 
> You can have a StatusListener which will see all status messages, 
> including those generated by rollover. Your listener can ignore all 
> status messages except those pertaining to rollover.
> 
> let us know if it the above works for you,
> 
> --
> Ceki
> _______________________________________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://mailman.qos.ch/mailman/listinfo/logback-user
> 
> 

-- 
View this message in context: http://old.nabble.com/listening-on-rolling-events-tp32854850p32861639.html
Sent from the Logback User mailing list archive at Nabble.com.



More information about the Logback-user mailing list