add a Delete action to delete logs older than 30D (#64)

* delete old logs files
* do not fork compilation

Signed-off-by: Olivier Lamy <olamy@apache.org>
This commit is contained in:
Olivier Lamy 2022-04-11 07:53:28 +10:00 committed by GitHub
parent 432c752e58
commit 081c490d2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 1 deletions

2
Jenkinsfile vendored
View File

@ -72,7 +72,7 @@ pipeline {
// -Dmaven.compiler.fork=false: Do not compile in a separate forked process
// -Dmaven.test.failure.ignore=true: Do not stop, if some tests fail
// -Pci-build: Profile for CI-Server
sh "mvn clean install -B -U -e -fae -T2 -Dmaven.compiler.fork=true -Pci-build"
sh "mvn clean install -B -U -e -fae -T2 -Pci-build"
}
}
}

View File

@ -36,6 +36,13 @@
<Policies>
<TimeBasedTriggeringPolicy />
</Policies>
<DefaultRolloverStrategy max="30">
<Delete basePath="${logsDirectory}" maxDepth="2">
<IfFileName glob="*/*.log">
<IfLastModified age="P30D"/>
</IfFileName>
</Delete>
</DefaultRolloverStrategy>
</RollingRandomAccessFile>
<RollingRandomAccessFile name="auditlog" fileName="${logsDirectory}/archiva-audit.log"
@ -47,6 +54,13 @@
<Policies>
<TimeBasedTriggeringPolicy />
</Policies>
<DefaultRolloverStrategy max="30">
<Delete basePath="${logsDirectory}" maxDepth="2">
<IfFileName glob="*/*.log">
<IfLastModified age="P30D"/>
</IfFileName>
</Delete>
</DefaultRolloverStrategy>
</RollingRandomAccessFile>
</appenders>