[
https://issues.apache.org/jira/browse/LOG4J2-2289?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Hari Menon updated LOG4J2-2289:
-------------------------------
Description:
The [log4j-config.xsd
file|https://github.com/apache/logging-log4j2/blob/80d025ba68fc12d7b4d767fb25455306878279e1/log4j-core/src/main/resources/Log4j-config.xsd]
defines KeyValuePairs in Filter as:
{code:xml}
<xs:sequence>
<xs:element name="KeyValuePair" type="KeyValuePairType" minOccurs="0"/>
</xs:sequence>
{code}
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:
{code:xml}
<Filter type="DynamicThresholdFilter" key="some-key" defaultThreshold="INFO"
onMatch="ACCEPT" onMismatch="NEUTRAL">
<KeyValuePair key="debug" value="DEBUG"/>
<KeyValuePair key="trace" value="TRACE"/>
</Filter>
{code}
If I remove one of the KeyValuePairs, it would pass. I use strict=true, and I
cannot change that for various other reasons.
was:
The [log4j-config.xsd
file|https://github.com/apache/logging-log4j2/blob/80d025ba68fc12d7b4d767fb25455306878279e1/log4j-core/src/main/resources/Log4j-config.xsd]
defines KeyValuePairs in Filter as:
{code:xml}
<xs:sequence>
<xs:element name="KeyValuePair" type="KeyValuePairType" minOccurs="0"/>
</xs:sequence>
{code}
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:
{code: xml}
<Filter type="DynamicThresholdFilter" key="some-key" defaultThreshold="INFO"
onMatch="ACCEPT" onMismatch="NEUTRAL">
<KeyValuePair key="debug" value="DEBUG"/>
<KeyValuePair key="trace" value="TRACE"/>
</Filter>
{code}
If I remove one of the KeyValuePairs, it would pass. I use strict=true, and I
cannot change that for various other reasons.
> DynamicFilterThreshold does not accept multiple KeyValuePairs
> -------------------------------------------------------------
>
> Key: LOG4J2-2289
> URL: https://issues.apache.org/jira/browse/LOG4J2-2289
> Project: Log4j 2
> Issue Type: Bug
> Reporter: Hari Menon
> Priority: Major
>
> The [log4j-config.xsd
> file|https://github.com/apache/logging-log4j2/blob/80d025ba68fc12d7b4d767fb25455306878279e1/log4j-core/src/main/resources/Log4j-config.xsd]
> defines KeyValuePairs in Filter as:
> {code:xml}
> <xs:sequence>
> <xs:element name="KeyValuePair" type="KeyValuePairType" minOccurs="0"/>
> </xs:sequence>
> {code}
> 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:
> {code:xml}
> <Filter type="DynamicThresholdFilter" key="some-key"
> defaultThreshold="INFO"
> onMatch="ACCEPT" onMismatch="NEUTRAL">
> <KeyValuePair key="debug" value="DEBUG"/>
> <KeyValuePair key="trace" value="TRACE"/>
> </Filter>
> {code}
> If I remove one of the KeyValuePairs, it would pass. I use strict=true, and I
> cannot change that for various other reasons.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)