...
Add the following parameters to the
log4j.properties
file (stored in the<EI_HOME>/conf/
directory):Code Block # correlationAppender logsconfig for correlation logs log4j.logger.correlationCORRELATION_LOGGER=INFO, CORRELATION log4j.additivity.correlationCORRELATION_LOGGER=false # Appender config for correlation logs log4j.appender.CORRELATION=org.apache.log4j.RollingFileAppender log4j.appender.CORRELATION.MaxFileSize=10MB log4j.appender.CORRELATION.File=${carbon.home}/repository/logs/${instance.log}/correlation.log log4j.appender.CORRELATION.MaxFileSize=10MB log4j.appender.CORRELATION.layout=org.apache.log4j.PatternLayout log4j.appender.CORRELATION.Threshold=INFO log4j.appender.CORRELATION.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS}|%X{Correlation-ID}|%t|%m%n
Note that the maximum file size of the correlation log is set to 10MB in the above configuration. That is, when the size of the file exceeds 10MB, a new log file is created. If required, you can change this file size.
If required, you can change the default HTTP header (which is 'activity_id') that is used to carry the correlation ID by adding the following property to the
passthru-http.properties
file (stored in the<EI_HOME>/conf/
directory). Replace<correlation_id>
with a value of your choice.Code Block correlation_header_name=<correlation_id>
...
If you want correlation logs to be enabled every time the server starts, add the following system property to the product start-up script (stored in the
<EI_HOME>/bin/
directory) and set it totrue
.Code Block -DenableCorrelationLogsDEnableCorrelationLogs=true \
Alternatively, you can pass the system property at the time of starting the server by executing the following command:
On Linux/MacOS/CentOS sh integrator.sh
-DenableCorrelationLogsDEnableCorrelationLogs=
true
On Windows integrator.bat
-DenableCorrelationLogsDEnableCorrelationLogs=
true
Now when you start the ESB server, the correlation.log
file is created in the <EI_HOME>/repository/logs/
directory.
...