]> source.dussan.org Git - archiva.git/commitdiff
add a Delete action to delete logs older than 30D (#64)
authorOlivier Lamy <olamy@apache.org>
Sun, 10 Apr 2022 21:53:28 +0000 (07:53 +1000)
committerGitHub <noreply@github.com>
Sun, 10 Apr 2022 21:53:28 +0000 (07:53 +1000)
* delete old logs files
* do not fork compilation

Signed-off-by: Olivier Lamy <olamy@apache.org>
Jenkinsfile
archiva-modules/archiva-web/archiva-webapp/src/main/resources/log4j2.xml

index b7fa99980c8cdd0ca80567e8682c7b4f187f9442..7d60a36af2defc3126cf3e8f0a5439f5cd1c097e 100644 (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"
                             }
                 }
             }
index 462ebddfb3fb5cd36988a7ecffb1110d86277fb7..352183a2bb5ba42cb4a1f0e883eddc0634f7e75e 100644 (file)
       <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"
       <Policies>
         <TimeBasedTriggeringPolicy />
       </Policies>
+      <DefaultRolloverStrategy max="30">
+        <Delete basePath="${logsDirectory}" maxDepth="2">
+          <IfFileName glob="*/*.log">
+            <IfLastModified age="P30D"/>
+          </IfFileName>
+        </Delete>
+      </DefaultRolloverStrategy>
     </RollingRandomAccessFile>
 
   </appenders>