Enabling SQL logging turned out the be quite easy, but it took a while to figure out, because the current top search results are out of date: they work with older versions of MyBatis (or iBatis).
To cut to the chase, the solution is simply to set the logger "org.activiti.engine.impl.persistence.entity" to level DEBUG:
<logger name="org.activiti.engine.impl.persistence.entity" level="DEBUG" />In our case we are only interested in SQL statements for the ExecutionEntity, so our configuration can be more specific:
<logger name="org.activiti.engine.impl.persistence.entity.ExecutionEntity" level="DEBUG" />For process/task variables:
<logger name="org.activiti.engine.impl.persistence.entity.VariableInstanceEntity" level="DEBUG" />