In grails I want to stop logging some specific exceptions occouring in my controllers.
I have managed this exception with urlmapping to render a custome warning page
Es my url mapping
"500"(controller:'error', action:'excOne', exception: MyExceptionOne)
"500"(controller:'error', action:'excTwo', exception: MyExceptionTwo)
But this exceptions continued to be logged by log4j. How I can exclude them from logging?
This is my log4j config:
log4j = {
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.commons', // core / classloading
'org.codehaus.groovy.grails.plugins', // plugins
'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration
'org.springframework',
'org.hibernate',
'net.sf.ehcache.hibernate',
'grails.app.services.org.grails.plugin.resource',
'grails.app.taglib.org.grails.plugin.resource',
'grails.app.resourceMappers.org.grails.plugin.resource',
'grails.app.services.NavigationService'
warn 'org.mortbay.log'
debug "com.myproject.*"
debug "grails.app"
debug "com.myproject.*"
appenders {
console name:'stdout', layout:pattern(conversionPattern: '[%r] %c{2} %m%n')
}
root {
error 'stdout'
warn 'stdout'
additivity = true
}
}