I am using logback for rollover of log files. I am able to fix the size of each file, and max number of files each day. But i have one more requirement to complete, i.e. the total number of size should not exceed a maximum number. To elaborate, say i have per day files limit is 10, now i want to set max file limit 50. So any day after 5th day(not necessarily exactly after 5th day. It may happen that one certain day only 2 files are generated. ) it will reach maximum numbers of file.
this is what my current code looks like. Can anyone please edit this to achieve the result i am expecting
<appender name="MAINLOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>./logs/usageHub.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<maxHistory>90</maxHistory>
<timeBasedFileNamingAndTriggeringPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 100MB -->
<maxFileSize>10MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<charset>utf-8</charset>
<Pattern>[%p] %d{yyyy-MMM-dd HH:mm:ss,SSS} %c - %m%n</Pattern>
</encoder>
</appender>