Details
Description
add the capability to exchange the defauly log4j logging implementation with a different framework (e.g. logback). Ideally the mechanism to do so would be identical to Grails as outlined in this article: http://www.lazygun.net/grails-replacing-log4j-with-logback
See the griffon user mailing list discussion: How does one replace log4j with logback
Activity
Andres Almiray
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Component/s | cli [ 13611 ] | |
| Component/s | rt [ 13475 ] |
Andres Almiray
made changes -
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Fix Version/s | 0.9.5 [ 17352 ] | |
| Resolution | Fixed [ 1 ] |
Andres Almiray
made changes -
| Status | Resolved [ 5 ] | Closed [ 6 ] |
Instructions as explained on that blog post do work for Griffon too.
1. Exclude log4j dependencies from global space, but do not exclude log4j-1.2.16 as it will cause a CNFE at runtime (some classes are required by the logging DSL).
2. configure Logback in the dependency DSL, like this
griffon.project.dependency.resolution = { inherits("global") { excludes 'slf4j-log4j12', 'log4j-over-slf4j' } log "warn" repositories { griffonHome() mavenCentral() } dependencies { String logbackVersion = '1.0.0' build "ch.qos.logback:logback-core:$logbackVersion", "ch.qos.logback:logback-classic:$logbackVersion" runtime "ch.qos.logback:logback-core:$logbackVersion", "ch.qos.logback:logback-classic:$logbackVersion" } }3. Create a suitable Logback configuration in griffon-app/conf/resources/logback.xml
4. Profit!