DynamicThresholdFilter not filtering

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

DynamicThresholdFilter not filtering

JOSE L MARTINEZ-AVIAL
I'm migrating my webapp to Log4j2 Slf4j and and I want to use
DynamicThresholdFilter to disable the logging of specific actions. In order
to do that, I'm using a J2EE Filter that sets a property in the MDC, as
follows:

MDC.put("DONOTLOG","true");

And then I have the following setup in the Log4j (Configuration wide):

<DynamicThresholdFilter key="DONOTLOG" onMatch="ACCEPT" onMismatch="NEUTRAL">
    <KeyValuePair key="true" value="ERROR"/>
</DynamicThresholdFilter>

But it is not filtering the logs events with level below ERROR. What I am
doing wrong?


https://stackoverflow.com/questions/45166666/dynamicthresholdfilter-not-filtering
Loading...