You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@iotdb.apache.org by 孙泽嵩 <sz...@mails.tsinghua.edu.cn> on 2020/10/29 03:00:20 UTC

Change logback rollingPolicy and triggeringPolicy

Greetings,

Currently, I noticed that our log files would not be auto deleted after reaching a specific number, and the log files would be more and more. 

Therefore, I change logback configuration in PR [1] (and PR[2] for rel/0.10):

	• Update rollingPolicy from TimeBasedRollingPolicy to FixedWindowRollingPolicy (to delete old files according to number of files)
	• Add triggeringPolicy of SizeBasedTriggeringPolicy (to limit the size of log file)

Since there is no need to maintain timestamp in log file name.

For example,

        <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
            <fileNamePattern>${LOG_PATH}/log-error.%i.log</fileNamePattern>
            <minIndex>1</minIndex>
            <maxIndex>10</maxIndex>
        </rollingPolicy>
        <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
            <maxFileSize>10MB</maxFileSize>
        </triggeringPolicy>

As for log-error and log-warn, maxFileSize is 10MB, maxIndex is 10;
As for log-info and log-debug, maxFileSize is 50MB, maxIndex is 10 (As is discussed in this PR [3]).

Do you have any other suggestions?


[1] https://github.com/apache/iotdb/pull/1895
[2] https://github.com/apache/iotdb/pull/1896
[3] https://github.com/apache/iotdb/pull/1001#issuecomment-610445716


Best,
-----------------------------------
Zesong Sun
School of Software, Tsinghua University

孙泽嵩
清华大学 软件学院