Log Rotation Triggering Policy

Log rotation rollover in MATRIXX gateways and web apps is triggered based on file size and a maximum number of files.

The default values are a file size of 20 MB and a maximum number of 10 files.

Log Rotation Environment Variables describes the environment variables that control file size and maximum number. Use these environment variables as values for the SizeBasedTriggeringPolicy and DefaultRolloverStrategy elements in the log4j2.xml file for the component.

Table 1. Log Rotation Environment Variables
Environment Variable Description
FILE_LOG_SIZE File size used for triggering rollover. The default value is 20 MB.
FILE_LOG_MAX The maximum number of old archives. Once this value is reached, older archives are deleted on later rollovers. The default value is 10.

The following YAML excerpt shows configuration of these environment variables, where component is one of the MATRIXX gateways or webapps, such as rsgateway.

component:
  configuration:
    env:
     - name: FILE_LOG_SIZE
       value: '1 MB'
     - name: FILE_LOG_MAX
       value: '10'

For more information about component log4j2 configuration, see the discussion about web app logging. For more information about using environment variables, see the discussion about environment variables and command arguments in MATRIXX Installation and Upgrade.