Hi All,
I have a CAS server that uses log4j2 to manage its log files. I tried to
configure log rotation by following the examples, but was unable to. Can anyone
see why the old files are not deleted?
<RollingFile name="file" fileName="${sys:cas.log.dir}/cas.log"
append="true"
filePattern="${sys:cas.log.dir}/cas-%d{yyyy-MM-dd-HH}-%i.log">
<PatternLayout pattern="%d %p [%c] - <%m>%n"/>
<Policies>
<OnStartupTriggeringPolicy />
<SizeBasedTriggeringPolicy size="10 MB"/>
<TimeBasedTriggeringPolicy />
</Policies>
<DefaultRolloverStrategy>
<Delete basePath="${sys:cas.log.dir}" maxDepth="2">
<IfFileName glob="*/cas-*.log" />
<IfLastModified age="10d" />
</Delete>
</DefaultRolloverStrategy>
</RollingFile>
Obviously, I could create a script and add it to crontab, but I would rather
use this.
~ Bob