My current logback config looks like this:
<appender name="rolling" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.dir}/${log.package}.log</file>
<encoder>
<Pattern>${log.pattern}</Pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.dir}/${log.package}.%d{yyyy-MM-dd}.%i.log.zip</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 1MB. -->
<maxFileSize>1MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!-- Keep no more than 3 months data. -->
<maxHistory>90</maxHistory>
<cleanHistoryOnStart>true</cleanHistoryOnStart>
</rollingPolicy>
</appender>
This works fine but irritatingly creates multiple zip file ...1.zip
...2.zip
etc.
Is there any way I can specify the zip file name as ${log.dir}/${log.package}.%d{yyyy-MM-dd}.log.zip
but the name of the files in the zip file as ${log.dir}/${log.package}.%i.log
? I.e. make one zip file per day but each time the file reaches 1mb I zip it as ....1.log
, ...2.log
etc.