Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The logback config file is in WEB-INF/classes in each webapp directory and can be edited.

For example, for the nodecollector* webapp, the default file would be in /opt/abiquo/tomcat/webapps/nodecollector/WEB-INF/classes/log????logback.xml

(*Nodecollector is the name of the webapp for the Discovery Manager Remote Service). 

logback.xml Example

The following example shows the standard default logback configuration log for "nodecollector" ...

 

for nodecollector 

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>
  </timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>

...

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>

 

 

 

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.

...