Add to grails Config.groovy
:
environments {
development {
grails.logging.jul.usebridge = true
}
production {
grails.logging.jul.usebridge = false
// Overwrite root logger to only log error messages:
log4j = {
root { error() }
}
}
}
A full log4j config may look like:
environments {
development {
grails.logging.jul.usebridge = true
}
production {
grails.logging.jul.usebridge = false
log4j = {
root { error() }
}
}
}
log4j.main = {
debug 'my.app.package'
error 'org.codehaus.groovy.grails.web.servlet', // controllers
'org.codehaus.groovy.grails.web.pages', // GSP
'org.codehaus.groovy.grails.web.sitemesh', // layouts
'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping
'org.codehaus.groovy.grails.web.mapping', // URL mapping
'org.codehaus.groovy.grails.commons', // core / classloading
'org.codehaus.groovy.grails.plugins', // plugins
'org.codehaus.groovy.grails.orm.hibernate', // hibernate
'org.springframework',
'org.hibernate',
'net.sf.ehcache.hibernate'
info 'org.springframework.security'
debug 'grails.app.controllers', // messages from app's grails artefacts
'grails.app.conf',
'grails.app.domain',
'grails.app.services',
'grails.app.jobs'
}