Printing Camunda's SQL statements

I am looking for a way to see/log (printing as a string with the System.out.println is preferable ) the SQL statements which are executed when executing the RUNTIME_SERVICE.createProcessInstanceQuery().variableValueEquals(…) service.
Thank you in advance.
CU

Hi,

Please check this post:

Best regards,
Yana

1 Like

Hello Yana
Thank you very much for the quick response.
As I understand I have to instantiate a log instance such like that:
protected static final EnginePersistenceLogger LOG = ProcessEngineLogger.PERSISTENCE_LOGGER;
But what will be the actual usage of this logger?
For instance, I would like to see what kind of SQL statement executes in the following line:
ProcessInstance PI = RUNTIME_SERVICE.createProcessInstanceQuery().variableValueEquals(CamundaUtility.VARIABLE_DNA_NUMBER, coaDraftId).singleResult();

How should I do that?
Thank you in advance

Hi,

The queries have already loggers, you don’t need to instantiate a log instance.
You need to set the logger org.camunda.bpm.engine.impl.persistence.entity to DEBUG.

You have to add it to engine/src/test/resources/logback-test.xml and the output should appear in the surefire reports.

Best regards,
Yana

1 Like

Yana, we don’t have a camunda server. We are using camunda’s java APIs. We have camunda jar (camunda-engine-7.3.0.jar) in the classpath and thats it
Thank you,
CU