fix #2716 add backup.max.age

This commit is contained in:
Shinsuke Sugaya 2023-01-29 16:23:13 +09:00
parent ee23c5a1f6
commit e4783cda52
3 changed files with 10 additions and 4 deletions

View file

@ -8,7 +8,8 @@
<Property name="log.pattern" value="%d [%t] %-5p %msg%n" />
<Property name="log.file.basedir" value="${sys:fess.log.path:-target/logs}" />
<Property name="backup.date.suffix" value="_%d{yyyyMMdd}" />
<Property name="backup.max.history" value="90" />
<Property name="backup.max.history" value="10" />
<Property name="backup.max.age" value="90" />
<Property name="audit.log.pattern" value="%msg%n" />
<Property name="searchlog.log.pattern" value="%msg%n" />
</Properties>
@ -24,7 +25,12 @@
<SizeBasedTriggeringPolicy size="100 MB" />
</Policies>
<DefaultRolloverStrategy fileIndex="max" min="1"
max="${backup.max.history}" compressionLevel="9" />
max="${backup.max.history}" compressionLevel="9">
<Delete basePath="${log.file.basedir}">
<IfFileName glob="*.log.gz" />
<IfLastModified age="P${backup.max.age}D" />
</Delete>
</DefaultRolloverStrategy>
</RollingFile>
<RollingFile name="AuditFile" fileName="${log.file.basedir}/audit.log"
filePattern="${log.file.basedir}/audit${backup.date.suffix}-%i.log.gz">

View file

@ -8,7 +8,7 @@
<Property name="log.pattern" value="%d [%t] %-5p %msg%n" />
<Property name="log.file.basedir" value="${sys:fess.log.path:-target/logs}" />
<Property name="backup.date.suffix" value="_%d{yyyyMMdd}" />
<Property name="backup.max.history" value="90" />
<Property name="backup.max.history" value="10" />
<Property name="stats.log.pattern" value="%msg%n" />
</Properties>

View file

@ -8,7 +8,7 @@
<Property name="log.pattern" value="%d [%t] %-5p %msg%n" />
<Property name="log.file.basedir" value="${sys:fess.log.path:-target/logs}" />
<Property name="backup.date.suffix" value="_%d{yyyyMMdd}" />
<Property name="backup.max.history" value="90" />
<Property name="backup.max.history" value="10" />
</Properties>
<Appenders>