[logback-user] TimeBasedRollingPolicy stop rolling after running for some time
fengqiang
fengqiang at mwi.com.sg
Fri Sep 1 10:46:08 CEST 2017
Hello we are using logback for our server. one issue keeps on happening for
more than one year. We are using TimeBasedRollingPolicy, the logback works
well when server starts and the log rolls according to size and date
correctly. However it stops rolling after running for some time (1 or 2
weeks) and the log file become extremely huge, 1 or 2 GB. Recently I found
it started when we copied logs from the server, then the rolling stop, the
size of all the log files in the folder increase without stop. my logback
configuration is as follows:
<configuration scan="true" scanPeriod="300 seconds">
<appender name="DATAMGR_FILE"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>../log/datamgr.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<FileNamePattern>../log/%d{yyyy-MM-dd,aux}/#%i.datamgr.%d{yyyy-MM-dd}.log.zip</FileNamePattern>
<maxHistory>60</maxHistory>
<timeBasedFileNamingAndTriggeringPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>5MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<cleanHistoryOnStart>true</cleanHistoryOnStart>
</rollingPolicy>
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS}; [%thread]; %-5level;
%class{30}.%method:%line; %msg%n</Pattern>
</layout>
</appender>
<logger name="com.mwi.cad.datamgr" level="info" additivity="false">
<appender-ref ref="DATAMGR_FILE" />
</logger>
</configuration>
Anybody could give me some idea what I should do to solve this problem. Is
there any work around I can do? any enlightenment would be greatly
appreciated!
--
Sent from: http://logback.10977.n7.nabble.com/Users-f3.html
More information about the logback-user
mailing list