I have this configurarion:
<appender name="ROLLIN" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${SCRIPTMON_HOME}/logs/scriptMon.log</file>
<encoder>
<pattern>%d{yyyy-MMM-dd HH:mm:ss.SSS} %-5level [%thread] %logger{15} - %msg%n</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>${SCRIPTMON_HOME}/logs/scriptMon.%d{yyyy-MM-dd}.%i.log.zip</fileNamePattern>
<minIndex>1</minIndex>
<maxIndex>10</maxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>5MB</maxFileSize>
</triggeringPolicy>
</appender>
IFAIK my logfile must rotate when it reaches 5MB (this is all I want regardless the date). I can in one run in Springboot achieve more than 10MB and the files stays the same.
I would appreciate any help.
Thanks.
Try changing
<fileNamePattern>${SCRIPTMON_HOME}/logs/scriptMon.%d{yyyy-MM-dd}.%i.log.zip</fileNamePattern>
to
<fileNamePattern>${SCRIPTMON_HOME}/logs/scriptMon.%i.log.zip</fileNamePattern>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With