This documentation is for WSO2 Enterprise Integrator version 6.0.0 . View documentation for the latest release.

All docs This doc
Skip to end of metadata
Go to start of metadata

The advantage of having per-API log files is that it is very easy to analyze/monitor the basic logs relevant to a REST API defined in the ESB. The API log is an additional log file, which will contain a copy of the logs to a particular REST API.

Below are the configuration details to configure the logs of a REST API called TestAPI using log4j properties. Open the <EI_HOME>/conf/log4j.properties file using your favorite text editor to configure log4j to log the API specific logs to a file. You can configure the logger for either INFO level logs or DEBUG level logs as follows:

INFO level

Add the following section to the end of the file to configure the logger for log messages where the Log Category is  INFO.

log4j.category.API_LOGGER=INFO, API_APPENDER
log4j.additivity.API_LOGGER=false
log4j.appender.API_APPENDER=org.apache.log4j.RollingFileAppender
log4j.appender.API_APPENDER.File=${carbon.home}/repository/logs/${instance.log}/wso2-ei-api${instance.log}.log
log4j.appender.API_APPENDER.MaxFileSize=1000KB
log4j.appender.API_APPENDER.MaxBackupIndex=10
log4j.appender.API_APPENDER.layout=org.apache.log4j.PatternLayout
log4j.appender.API_APPENDER.layout.ConversionPattern=%d{ISO8601} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n</pre>
DEBUG level

Add the following section to the end of the file to configure the logger for log messages where the Log Category is DEBUG.

log4j.category.API_LOGGER.TestAPI=DEBUG, TEST_API_APPENDER
log4j.additivity.API_LOGGER.TestAPI=false
log4j.appender.TEST_API_APPENDER=org.apache.log4j.DailyRollingFileAppender
log4j.appender.TEST_API_APPENDER.File=${carbon.home}/repository/logs/${instance.log}/TestAPI.log
log4j.appender.TEST_API_APPENDER.datePattern='.'yyyy-MM-dd-HH-mm
log4j.appender.TEST_API_APPENDER.layout=org.apache.log4j.PatternLayout
log4j.appender.TEST_API_APPENDER.layout.ConversionPattern=%d{ISO8601} [%X{ip}-%X{host}] [%t] %5p %c{1} %m%n

The above configuration creates a log file named TestAPI.log in the <EI_HOME>/repository/logs directory.

  • No labels