Hi,
I am struggeling with the following config for logback:
<appender name="EVENTFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${openhab.logdir:-logs}/events.log</file>
<!-- http://logback.qos.ch/manual/appenders.html#SizeAndTimeBasedRollingPolicy -->
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!-- weekly rollover and archiving -->
<fileNamePattern>${openhab.logdir:-logs}/events-%d{yyyy-ww}.%i.log.zip</fileNamePattern>
<maxFileSize>5MB</maxFileSize> <!-- archive at this file size -->
<maxHistory>5</maxHistory> <!-- maximum number of archive files to keep -->
<totalSizeCap>20MB</totalSizeCap> <!-- maximum size of all logs -->
</rollingPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss} - %msg%n</pattern>
</encoder>
</appender>
According to the documentation it should rollover at 5MB or on a weekly basis.
Unfortunately it doesn’t seem to have any effect.
Edit:
I think I found the issue:
Openhab uses an ancient logback from 2012!
Could anyone be so kind and create pull request with the recent version 1.7.1?
This would be much appreciated.