Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You can limit the size of the <PRODUCT_HOME>/repository/logs/wso2carbon.log file by following the steps given below. This is useful if you want to archive the logs and get backups periodically.

  1. Change Add org.apache.log4j.RollingFileAppender as the value of the log4j.appender.CARBON_LOGFILE=org.wso2.carbon.logging.appenders.CarbonDailyRollingFileAppender appender  property in the <PRODUCT_HOME>/repository/conf/log4j.properties file as follows.
    log4j.appender.CARBON_LOGFILE=org.apache.log4j.RollingFileAppender
  2. Add the following two properties under RollingFileAppender.

    log4j.appender.CARBON_LOGFILE.MaxFileSize=10MB 
    log4j.appender.CARBON_LOGFILE.MaxBackupIndex=20

    Info

    If the size of the log file is exceeding the value defined in the MaxFileSize property, then the content is copied to a backup file and the logs are continued to be added to a new empty log file. The MaxBackupIndex property makes the Log4j keep a given maximum number of backup files for the logs.