...
The log4j-
based logging mechanism uses appenders to append all the log messages into a file. That is, at the end of the log rotation period, a new file will be created with the appended logs and archived. The name of the archived log file will always contain the date on which the file is archived.
Identifying forged messages: From Carbon 4.4.3 onwards, it is possible to use a UUID in log messages so that any forged messages can be easily identified. The UUID is logged using a new conversion character ‘K’ in the log pattern layout. By default, the UUID will be generated every time the server starts. However, you can configure your server to generate the UUID more or less frequently, by specifying an exact time interval in the log4j.properties
file. See the section on configuring log4j properties for more information on log patterns.
See the following topics related to log management in WSO2 Carbon products;
Table of Contents | ||||
---|---|---|---|---|
|
...
- 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 thewso2carbon.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
- 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 by following the steps given below. This is useful if you want to archive the logs and get backups periodically.
- Add
org.apache.log4j.RollingFileAppender
as the value of thelog4j.appender.CARBON_LOGFILE
property in the<PRODUCT_HOME>/repository/conf/
log4j.properties
file as follows.log4j.appender.CARBON_LOGFILE=org.apache.log4j.RollingFileAppender
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. TheMaxBackupIndex
property makes the Log4j keep a given maximum number of backup files for the logs.