Erik Kemperman created LOG4J2-1215:
--------------------------------------
Summary: Documentation/XSD inconsistencies
Key: LOG4J2-1215
URL: https://issues.apache.org/jira/browse/LOG4J2-1215
Project: Log4j 2
Issue Type: Bug
Components: Configurators, Documentation
Affects Versions: 2.4, 2.5
Reporter: Erik Kemperman
Priority: Minor
I was trying to validate my log4j2.xml against the shipped Log4j-config.xsd,
but I think I've found some inconsistencies between what the documentation says
and what the xsd enforces:
- ConfigurationType doesn't allow for a "schema" attribute.
- PropertiesType doesn't allow for more than one Property.
- LayoutType requires attributes with capital letters, "Type" and "Pattern".
If I apply the following patch to the xsd, things work as expected. So I
thought I'd submit that here:
{code}
--- Log4j-config.xsd 2015-12-08 15:32:14.413679998 +0100
+++ Log4j-config.fixed.xsd 2015-12-08 15:22:25.176312276 +0100
@@ -38,10 +38,11 @@
<xs:attribute name="strict" type="xs:string"/>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="advertiser" type="xs:string"/>
+ <xs:attribute name="schema" type="xs:string"/>
</xs:complexType>
<xs:complexType name="PropertiesType">
<xs:sequence>
- <xs:element name="Property" type="PropertyType"/>
+ <xs:element name="Property" type="PropertyType" minOccurs="0"
maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="AppenderType">
@@ -135,8 +136,8 @@
<xs:sequence>
<xs:element name="Pattern" type="xs:string" minOccurs="0"/>
</xs:sequence>
- <xs:attribute name="Type" type="xs:string" use="required"/>
- <xs:attribute name="Pattern" type="xs:string" use="optional"/>
+ <xs:attribute name="type" type="xs:string" use="required"/>
+ <xs:attribute name="pattern" type="xs:string" use="optional"/>
</xs:complexType>
<xs:complexType name="ThresholdFilterType">
<xs:attribute name="level" type="xs:string" use="optional"/>
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]