How to change log level

Hey there.

So, my Camunda pretty much stopped executing jobs.

According to this post here The Job Executor: What Is Going on in My Process Engine? | Camunda, one of the first things I should do is turn on the debug logs.

Here is the logback.xml file that has been created:

<configuration>
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <!-- encoders are assigned the type
             ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
        <encoder>
            <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
        </encoder>
    </appender>
	
    <!-- camunda -->
    <logger name="org.camunda.bpm.engine.impl.persistence.entity.JobEntity" level="DEBUG"/>
    <logger name="org.camunda.bpm.engine.jobexecutor" level="DEBUG"/>
    <logger name="org.camunda.bpm.engine.cmd" level="DEBUG"/>
    
    <!-- common dependencies -->
    <logger name="org.apache.ibatis" level="INFO" />
    <logger name="javax.activation" level="INFO" />
    <logger name="org.springframework" level="INFO" />

    <root level="DEBUG">
        <appender-ref ref="STDOUT" />
    </root>
</configuration>

We then proceeded to reset the app and we can see something new, but still not debug level:

2023-12-01T05:02:30.930954533Z 01-Dec-2023 05:02:30.930 WARNING [pool-2-thread-3629] org.camunda.commons.logging.BaseLogger.logWarn ENGINE-14006 Exception while executing job 8ba46f85-758a-11ee-a197-7eda7dc5d5f0: OptimisticLockingException. To see the full stacktrace set logging level to DEBUG.

What am I missing?

Hi,

Which Camunda distribution or environment do you use? E.g. Tomcat shared engine, Spring Boot Starter, Camunda Run, …

Cheers,
Thorben

@thorben we’re using Tomcat hosted in Azure Web App Container Linux

Unless the Azure deployment customizes anything that I am not aware of, you can configure logging through the logging.properties file in Tomcat. This post has some details: Logback logging Camunda Engine - #2 by thorben. Note that Tomcat logging uses different names for levels: debugging - How to set level logging to DEBUG in Tomcat? - Stack Overflow.

Cheers,
Thorben

@thorben which is the correct directory to change the Tomcat config?

It is ${TOMCAT_HOME}/conf/. TOMCAT_HOME is the base directory of Tomcat.

Back with the same problem, but it might be related to something else.

Noticed in this part of the documentation that it’s necessary to add the dependency (which we didn’t before), but it isn’t clear ~where~ to put it

<dependency>
  <groupId>ch.qos.logback</groupId>
  <artifactId>logback-classic</artifactId>
  <version>1.1.2</version>
</dependency>

@thorben any suggestions?