/ Published in: Groovy
An example of a grails (2.x) log4j configuration (in grails-app/conf/Config.groovy).
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
environments { development { log4j = { appenders { file name: 'grailsfile', file: 'target/grails.log' file name: 'rootlog', file: 'target/root.log' file name: 'devfile', file: 'target/development.log', layout: pattern(conversionPattern: "[%d{HH:mm:ss:SSS}] %-5p %c{2}: %m%n") } root { error 'stdout', 'rootlog' } info additivity: false, grailsfile: 'org.codehaus.groovy.grails.commons' all additivity: false, devfile: [ 'grails.app.controllers.your.package', 'grails.app.domain.your.package', 'grails.app.services.your.package', 'grails.app.taglib.your.package', 'grails.app.conf.your.package', 'grails.app.filters.your.package' ] } } test { log4j = { appenders { file name: 'grailsfile', file: 'target/grails.log' file name: 'rootlog', file: 'target/root.log' file name: 'testfile', file: 'target/test.log', layout: pattern(conversionPattern: "[%d{HH:mm:ss:SSS}] %-5p %c{2}: %m%n") } root { error 'stdout', 'rootlog' } info additivity: false, grailsfile: 'org.codehaus.groovy.grails.commons' all additivity: false, testfile: [ 'grails.app.controllers.your.package', 'grails.app.domain.your.package', 'grails.app.services.your.package', 'grails.app.taglib.your.package', 'grails.app.conf.your.package', 'grails.app.filters.your.package' ] } } production { log4j = { root { error() } } } }