Managing the size of the log file

Log files record all the errors and notable events that are created by the user. As the size of the log files increase, you can maintain their size.

About this task

By default, the size of a log file is set to 10 MB and the number of backup files are set to five in the log4j2.xml file. This file is in the JazzInstallDir/server/conf/application directory, where application is jts, ccm, qm, rm, dcc, gc, ldx, lqe, relm, or rs. You can change the rollover property of the log4j2.xml file as needed.
Note: After the log file reaches its assigned maximum size for a specific process, it stops growing and a new log file for the same process will be created. If the number of log files associated with a single process exceeds the value that is defined in the MaxBackupIndex parameter, the first log file that was associated with that process will be cleared and reused for further logging.

Procedure

  1. To do size-based rollover, update the numeric value of the following lines:
    <RollingFile name="file" filename="${dir}/${app}.log" filePattern="${dir}/${app}-%i.log">
    <PatternLayout pattern="${pattern}"/>
    <Policies>
    <SizeBasedTriggeringPolicy size="10MB"/>
    </Policies>
    <DefaultRolloverStrategy max="5"/>
    </RollingFile>
    
    These lines limit the log file size to 10 MB and the number of backup files to 5.
  2. To reload the log4j settings, log on to the server and enter this URL in the address bar:
    https://hostname.example.com:9443/application_contextroot/admin#action=com.ibm.team.repository.admin.reloadLoggingSettings
  3. Click Reload Log Settings.
    The text Log Settings reloaded = [true] appears after the Reload Log Settings button indicating that the reload was successful.