I have log4j2 with a default rollover strategy set up like this -
<RollingFile name="RollingFile" fileName="cc" filePattern="logs/${baseFileName}-%d{yyyy-MM-dd}.log.gz">
<PatternLayout>
<pattern>%d{dd/MMM/yyyy HH:mm:ss,SSS}- %c{1}: %m%n</pattern>
</PatternLayout>
<Policies>
<TimeBasedTriggeringPolicy interval="1" modulate="true" />
</Policies>
<DefaultRolloverStrategy>
<Delete basePath="logs/">
<IfFileName glob="logs/${baseFileName}-*.log" />
<IfLastModified age="2d" />
</Delete>
</DefaultRolloverStrategy>
</RollingFile>
so it should be deleting the oldest files when it gets to over 2 days old correct?
my log files are stored in the base path of the project in a folder called logs..
however I just did a test run and it got to 5 files before I stopped it....
any idea what could be causing this?