Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-2289

XML Schema for DynamicFilterThreshold does not accept multiple KeyValuePairs

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.10.0
    • Component/s: None
    • Labels:
      None

      Description

      The log4j-config.xsd file defines KeyValuePairs in Filter as:

      <xs:sequence>
      <xs:element name="KeyValuePair" type="KeyValuePairType" minOccurs="0"/>
      </xs:sequence>
      

      DynamicThresholdFilter can in fact take multiple KeyValuePairs. But that will not pass xsd validation because KeyValuePair is missing 'maxOccurs="unbounded"' attribute.

      Example: The following config will fail validation, although it should not:

          <Filter type="DynamicThresholdFilter" key="some-key" defaultThreshold="INFO"
                                  onMatch="ACCEPT" onMismatch="NEUTRAL">
            <KeyValuePair key="debug" value="DEBUG"/>
            <KeyValuePair key="trace" value="TRACE"/>
          </Filter>
      

      If I remove one of the KeyValuePairs, it would pass. I use strict=true, and I cannot change that for various other reasons.

        Attachments

          Activity

            People

            • Assignee:
              garydgregory Gary Gregory
              Reporter:
              hshankar Hari Menon
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: