...
This configuration will rotate the logs daily or when the size of the file is larger than 50 MB. However, the standard configuration shown above does not means that the log files are kept indefinitely, which can cause the system disk to fill up.
So we suggest you specify the maxHistory parameter (as described on http://logback.qos.ch/manual/appenders.html).This means that the logs are kept indefinitely, which can cause the system disk to fill up
The optional maxHistory property controls the maximum number of archive files to keep, deleting older files. For example, if you specify monthly rollover, and set maxHistory to 6, then 6 months worth of archives files will be kept with files older than 6 months deleted. Note as old archived log files are removed, any folders which were created for the purpose of log file archiving will be removed as appropriate.
Set the maxHistory size for each log file by adding a line after maxFileSize and changing the \{NUMBER OF FILES TO KEEP} as shown in the example below.
Code Block | ||
---|---|---|
| ||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <fileNamePattern>${catalina.base}/logs/nodecollector-%d{yyyy-MM-dd}.%i.log</fileNamePattern> <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> <maxFileSize>50MB</maxFileSize> <maxHistory>{NUMBER OF FILES TO KEEP}</maxHistory> </timeBasedFileNamingAndTriggeringPolicy> </rollingPolicy> |
Abiquo recommends that you keep the files for one month.approximately one months' worth of files.