This section describes how to configure the Abiquo logs so that old webapp log files are periodically deleted. This will prevent problems due to lack of hard disk space.
Abiquo Log Documentation
The Abiquo Logs are described in detail the Troubleshooting section of this wiki.
Log files
A current log is created for each webapp in the directory \{catalina.base}/logs/
In a standard install, this is /opt/abiquo/tomcat/logs. The logs are named after the webapps and renamed with date information when they are rotated.
In Abiquo 2.4, the logs are:
am.log api.log bpm-async.log catalina.out nodecollector.log ssm.log virtualfactory.log vsm.log
The logback config file is in WEB-INF/classes in each webapp and can be edited.
For example, for the nodecollector webapp, the file would be in /opt/abiquo/tomcat/webapps/WEB-INF/classes/log????
(Nodecollector is the name of the webapp for the Discovery Manager Remote Service).
Example
The following example shows the standard configuration log for "nodecollector" ...
<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> </timeBasedFileNamingAndTriggeringPolicy> </rollingPolicy>
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 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.
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.
<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>
We can open an improvement in Jira and tell customers to configure they log files as they want.
El 29/05/2013 22:25, "Sergio Pena" <sergio.pena@abiquo.com> escribió:
Hi guys,
I think we do not specify any retention time on logback's configuration, We had one customer with a full filesystem today.
We define rotation policy as:
<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>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
Size and time based archiving supports deletion of old archive files. You need to specify the number of periods to preserve with the maxHistory property. When your application is stopped and restarted, logging will continue at the correct location, i.e. at the largest index number for the current period.
Is this intended by any reason? If so we should advise this on the wiki so customers can define their own retention times / rotation policies.
wdyt?