Configuring Cascade CMS Log Rotation and Compression

Overview

This article is provided as an example of how to configure Cascade CMS application logging to use rotation and/or compression. It is for informational purposes only, and Hannon Hill Product Support cannot provide Log4j2 configuration support or assistance.

Configuring Maximum Rotated Files

Cascade CMS application logging can be configured remove older log files over a specified number of rotations. To do so:

  • Edit tomcat/webapps/ROOT/WEB-INF/classes/log4j2.properties.
  • Locate the commented lines that look like the following and uncomment them by removing the hash (#) sign at the beginning:
    #appender.APPENDER_NAME.strategy.type = DefaultRolloverStrategy
    #appender.APPENDER_NAME.strategy.max = ${ROTATION_STRATEGY_MAX}
    
  • Save the changes.
  • Restart Cascade CMS.

Note: to change the maximum number of rotated log files, change the value of the property.ROTATION_STRATEGY_MAX property at the top of the same log4j2.properties file; the default is 7 days.

Configuring Rotated File Compression

Cascade CMS application logging can be configured to compress rotated log files. To do so:

  • Edit tomcat/webapps/ROOT/WEB-INF/classes/log4j2.properties.
  • Locate the following property:
    property.LOG_ROTATION_FILE_PATTERN = %d{yyyy-MM-dd}.log.gz
  • And change it to one the following for zip compression or to disable compression:
    property.LOG_ROTATION_FILE_PATTERN = %d{yyyy-MM-dd}.log.gz
    property.LOG_ROTATION_FILE_PATTERN = %d{yyyy-MM-dd}.log
    
  • Save the changes.
  • Restart Cascade CMS.