You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Hari Menon (JIRA)" <ji...@apache.org> on 2018/03/27 22:16:00 UTC
[jira] [Updated] (LOG4J2-2289) DynamicFilterThreshold does not
accept multiple KeyValuePairs
[ 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:java}
<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.
> 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)