System Configuration
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.
Enabling log rotation
Cascade CMS application logging can be configured remove older log files over a specified number of rotations. To do so:
- On the application server, locate and edit
tomcat/webapps/ROOT/WEB-INF/classes/log4j2.properties
. - Locate each of the commented-out lines that look like the following:
#appender.APPENDER_NAME.strategy.type = DefaultRolloverStrategy #appender.APPENDER_NAME.strategy.max = ${ROTATION_STRATEGY_MAX}
- Uncomment these lines by removing the hash sign (
#
) from the beginning of the line. - Save the changes.
- Restart Cascade CMS.
Note - By default, rotation is configured to 7 days. To change this setting, locate the
property.ROTATION_STRATEGY_MAX
property towards the top of the same log4j2.properties
configuration file and adjust the value to the desired number of days.Configuring log file compression
You can enable or disable automatic compression of rotated application log files using the following steps:
- On the application server, locate and edit
tomcat/webapps/ROOT/WEB-INF/classes/log4j2.properties
. - Locate the
property.LOG_ROTATION_FILE_PATTERN
property towards the top.- Enable compression: add a
.gz
(or.zip
) extension to the filename pattern - Disable compression: remove the
.gz
(or.zip
) extension from the filename pattern
- Enable compression: add a
- Save the changes.
- Restart Cascade CMS.