logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe <joej...@jme.de>
Subject Re: log4j2 getting started & rolling files
Date Sun, 29 Dec 2013 20:34:32 GMT
I found this post while looking for a solution for this problem:
   
http://stackoverflow.com/questions/20819376/log4j2-rollingfile-appender-add-custom-info-at-the-start-of-each-logfile

So, Ralph's statement makes me hope:
> You can already extend this class and override that method to perform work
> before or after doing super.rollover(fileManager).

Ok, extending DefaultRolloverStrategy is looks easy, like this dummy try:



But I stuck at two things:
- how to force the RollingFileAppender to use MyRolloverStrategy instead of
DefaultRolloverStrategy (seems that I have to deal with @Plugin and
@PluginFactory)?
- how to write to the logfiles within my rollover method?

Could you help me at this point?
I would be happy to get some sample source snippets.

Cheers, Joe




--
View this message in context: http://apache-logging.6191.n7.nabble.com/log4j2-getting-started-rolling-files-tp8406p42402.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


Mime
View raw message