Is there a way to specify a log4j filter in Grails log4j DSL configuration? I need to define something like this in my Grails log4j config:
<filter class="org.apache.log4j.filter.ExpressionFilter">
<param name="expression" value="EXCEPTION ~= com.company.BackendNotAvailableException" />
<param name="acceptOnMatch" value="false"/>
</filter>
I use Grails 1.3.7.
Thank you for your pointer. I did the same thing without an ExpressionFilter, so that I wouldn't have to load the additional Log4j Extras module, using a quick Groovy closure coercion:
In my case I wanted to filter some spurious messages generated by Hibernate on startup, so I put that code in Config.groovy, because Bootstrap would be executed too late.
Just an update, stumbled into this issue and found another solution (hope to serve this as a reference):
in Config.groovy,
I have worked around this issue by adding a short init code to Bootstrap.groovy