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

XML Schema for DynamicFilterThreshold does not accept multiple KeyValuePairs

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.10.0
    • None
    • 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

            ggregory Gary D. Gregory
            hshankar Hari Menon
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: