Bug 995133
| Summary: | jBPM should use 1 logging system (and standarize on slf4j with logback) | ||
|---|---|---|---|
| Product: | [Retired] JBoss BPMS Platform 6 | Reporter: | Geoffrey De Smet <gdesmet> |
| Component: | Build and Assembly | Assignee: | Geoffrey De Smet <gdesmet> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Ivo Bek <ibek> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 6.0.0 | CC: | mswiders, rrajasek |
| Target Milestone: | ER4 | ||
| Target Release: | 6.0.0 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2014-08-06 20:12:32 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 989519 | ||
cleaned up jbpm-executor, jbpm-test and jbpm-examples, pushed both to master and 6.0.x branch: https://github.com/droolsjbpm/jbpm/commit/82bb74193cd8cac40684257b9cfe8ac175d48fc2 Maciesj has fixed jbpm-executor, jbpm-examples, jbpm-test. gdesmet has fixed jbpm-distribution sr_pere is fixing on form-modeler tihimor is fixing on designer pere and tiho have fixed form-modeler and designer too. All fixed now. Verified. It's not mentioned but Geoffrey has removed slf4j-log4j12 from droolsjbpm-bpms-distribution https://github.com/droolsjbpm/droolsjbpm-integration/commit/aaeaa8a90e658e0eeda7ae07cdda796a7d6485ab |
Most modules use slf4j-logback. These don't and need to switch to that too: jbpm-form-modeler-renderer: commons-logging (compile time even!) jbpm-designer-backend: slf4j-jdk14 (compile time even!) jbpm-designer-client: slf4j-jdk14 (compile time even!) - Note: Many modules that depends on designer exclude logging dependencies because of this jbpm-distribution: slf4j-log4j12 jbpm-examples: slf4j-log4j12 jbpm-executor: slf4j-log4j12 jbpm-test: slf4j-log4j12 droolsjbpm-bpms-distribution: slf4j-log4j12 HOW TO USE SLF4J AND LOGBACK PROPERLY ===================================== Use slf4j with logback Here's how it works: 1) In your java code, use the slf4 interfaces: import org.slf4j.Logger; import org.slf4j.LoggerFactory; Sfl4j is just a very-efficiently logging interface, it doesn't actually log itself. Make sure you understand that logger.trace("Hello {}", username); is a LOT faster than than logger.trace("Hello " + username); if trace is disabled (which it usually is). 2) Add maven dependencies on slf4j-api and logback-classic: <!-- Logging --> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <scope>test</scope> <!--or <scope>runtime</scope> for examples and wars --> </dependency> Remove/exclude any log4j and slf4j-log4j dependencies. Note: log4j hasn't seen a release in 5 years. It's dead (and very slow). 3) Add a logback-test.xml file directly under in src/test/resources: For example: https://github.com/droolsjbpm/optaplanner/blob/master/optaplanner-examples/src/test/resources/logback-test.xml 4) For end-user jars (so examples and wars, but NOT jbpm-flow etc), add a logback.xml directly under src/main/resources: For example: https://github.com/droolsjbpm/optaplanner/blob/master/optaplanner-examples/src/main/resources/logback.xml Note: If both logback-text.xml and logback.xml are on the classpath, logback will ignore the latter and only use logback-text.xml. So never put logback-text.xml in a non-test classpath. 5) For more info: http://www.slf4j.org/manual.html (how to use from code) http://logback.qos.ch/documentation.html (how to configure it to do what you want it do)