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 log4j.properties 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 log4j.properties 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:
    • log4j.appender.file.MaxFileSize=10MB
    • log4j.appender.file.MaxBackupIndex=5
    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 below the Reload Log Settings button indicating that the reload was successful.
  4. You can also do time-based rollover, set a date, or do daily rollover. To do a daily rollover, in the log4j file change log4j.appender.file=org.apache.log4j.FileAppender to log4j.appender.file=org.apache.log4j.DailyRollingFileAppender.
    This change rolls over the log file every midnight.