Hi,
I want to enable logs in camunda in tomcat or wildfly in specific pattern using logback.xml.
I have put logback-classic-1.1.2.jar , logback-core-1.1.2.jar in tomcat/lib and camunda-webapp/lib and engine-rest/lib and put the logabck.xml in WEB-INF/classes of both camunda and engine-rest webapp.
I am getting the logs of camunda in catalina.out but not in the pattern i mentioned in logback.xml.
Logback.xml is below:
Please let me know if I need to include something more.
<?xml version="1.0" encoding="UTF-8"?> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>{"type":"${TYPE}", "host":"${HOST}", "level":"%replace(%level){TRACE,DEBUG}", "neid":"${NEID}", "system":"${SYSTEM}", "time":"%d{yyyy-MM-dd'T'HH:mm:ss.SSS'Z', UTC}", "timezone":"${TIMEZONE}", "log":"%msg"}%n</pattern>
</encoder>
</appender>
<!-- Send debug/info messages to a file-->
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>/opt/tomcat/test.log</file>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>{"type":"${TYPE}", "host":"${HOST}", "level":"%replace(%level){TRACE,DEBUG}", "neid":"${NEID}", "system":"${SYSTEM}", "time":"%d{yyyy-MM-dd'T'HH:mm:ss.SSS'Z', UTC}", "timezone":"${TIMEZONE}", "log":"%msg"}%n</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<FileNamePattern>/opt/tomcat/test.%i.log.zip</FileNamePattern>
<MinIndex>1</MinIndex>
<MaxIndex>10</MaxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>2MB</MaxFileSize>
</triggeringPolicy>
</appender>
<root level="DEBUG">
<appender-ref ref="STDOUT" />
<appender-ref ref="FILE" />
</root>
Regards,
Durga