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