logging-log4j2 icon indicating copy to clipboard operation
logging-log4j2 copied to clipboard

CompositeFilter doesn't work with multiple MarkerFilters

Open mgaceanu opened this issue 4 months ago • 1 comments

Description

The composite filter seem to not work with multiple MarkerFilters. I learned in the meantime about the existence of the NoMarkerFilter which fits my use case, but I guess chaining multiple MarkerFilters is still a valid scenario.

Here is my configuration:

      AppenderRef:
        - ref: Console
          Filters:
            - MarkerFilter:
                marker: COMMAND
                onMatch: DENY
                onMismatch: NEUTRAL
            - MarkerFilter:
                marker: METRICS
                onMatch: DENY
                onMismatch: NEUTRAL

You can see in the logs bellow, having two MarkerFIlters, COMMAND and METRICS, only the first one is taken into account.

Configuration

Version: 2.24.1

Operating system: Ubuntu 22.04

JDK: 8

Logs

2024-10-17T12:26:13,119 [main] INFO  MarkerExample - This is a METRICS log entry
2024-10-17T12:26:13,122 [main] INFO  MarkerExample - This is a general log entry without a marker

Reproduction

I'm attaching a test below demo.zip

mgaceanu avatar Oct 17 '24 10:10 mgaceanu