Versions Compared

Key

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

...

  • Through the log files that are stored in the <PRODUCT_HOME>/repository/logs folder. This folder contains current logs in a log file with a date stamp. Older logs are archived in the wso2carbon.log file.
  • Through the command prompt/shell terminal that opens when you run the "wso2server.bat"/"wso2server.sh" files to start the Carbon server.   
  • Through the advanced monitoring capabilities in WSO2 BAM. 
  • Through the management console of your product.

Limiting the size of the wso2carbon.log file

You can limit the size of the <PRODUCT_HOME>/repository/logs/wso2carbon.log file to archive and get backups of the logs stored in it periodically as preferred. Follow the steps below to add the configurations to limit the size of the <PRODUCT_HOME>/repository/logs/wso2carbon.log file.

  1. Change the log4j.appender.CARBON_LOGFILE=org.wso2.carbon.logging.appenders.CarbonDailyRollingFileAppender appender in the <PRODUCT_HOME>/repository/conf/log4j.properties file as follows.
    log4j.appender.CARBON_LOGFILE=org.apache.log4j.RollingFileAppender
  2. Add following two properties under the 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.