logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kireet <kir...@feedly.com>
Subject rolling in log4j2
Date Sat, 01 Feb 2014 00:28:36 GMT
I am trying to use the rolling file appender in log4j2, basically I want 
to roll at midnight daily and keep 3 old log files. New files are 
created properly, but log4j doesn't seem to be cleaning up the old 
files. Does log4j only support cleanup of files within the time period? 
Here is the relevant portion of the config. I tried things with and 
without the %i pattern.

     <RollingFile name="Event" fileName="app.log"
                  filePattern="app-%d{yyyy-MM-dd}.%i.log">
       <PatternLayout>
         <Pattern>%m%n</Pattern>
       </PatternLayout>
       <Policies>
         <TimeBasedTriggeringPolicy interval="1" modulate="true"/>
       </Policies>
       <DefaultRolloverStrategy compressionLevel="0" max="3"/>
     </RollingFile>


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