Details
-
Task
-
Resolution: Unresolved
-
Major
-
None
-
1.1.8
-
Ubuntu 14.04
logback.xml
Description
Hi help to complete the task .
I need only the last 500MB generated logs data each day and compress it and have backup of 10days and should delete the older file after 10th day
Even though i use rolling file appender its zipping the first 500MB data and creating a tmp file if the app generates extra 500mb data same day i need to store only 500mb data that to app lastestly generated logs .
He is my configuration :
<appender name="FILE-ROLLING" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>test.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>test.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<!-- each archived file, size max 500MB -->
<maxFileSize>500MB</maxFileSize>
<!-- total size of all archive files, if total size > 5GB, it will delete old archived file -->
<totalSizeCap>5GB</totalSizeCap>
<!-- 10 days to keep -->
<maxHistory>10</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss:SSS}*%m%n<</pattern>
</encoder>
</appender>