I started experimenting with Camunda engine and noticed that it bypasses my application's log and writes everything to stdout (or stderr?). How can I make it play nice like every other library?
The application has the following dependencies as far as logging is concerned (in build.gradle
):
// Replaced with SLF4j below. Make sure no libraries pull this as a dependency.
configurations.all {
exclude group: 'commons-logging'
}
dependencies {
compile 'org.slf4j:slf4j-api:1.7.12'
compile 'ch.qos.logback:logback-classic:1.1.3'
// Replaces Apache Commons Logging with SLF4j.
compile 'org.slf4j:jcl-over-slf4j:1.7.12'
}
So, libraries that log through SLF4j or Commons Logging are fine. But Camunda apparently had to invent yet another wheel...
Turned out to be not another wheel, but rather
java.util.logging
. It is possible to redirect that to SLF4j too with the following JAR:This bridge needs to be explicitly installed, however (Java code):
And for performance reasons, it is best to include this in Logback configuration: