I have a need to create a custom Filter (implementing java.util.logging.Filter) and programmatically add it to a given logger. I don't see isLoggable() in the Filter class get invoked. Is this something possible to do?
Because I couldn't get my custom filter to work, I tried programmatically adding a JBoss-implemented filter, org.jboss.logmanager.filters.DenyAllFilter, to a logger. This didn't have any effect either. The isLoggable() method didn't seem to get called either.
However, when I added this configuration in jboss-logging.xml:
<logger category="mytest">
<level name="INFO"/>
<filter>
<deny/>
</filter>
</logger>
it worked just fine.
So, my questions are: 1. is it possible to programmatically add a filter? 2. is it possible to use a custom filter?