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

Documentation/XSD inconsistencies

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.4, 2.5
    • None
    • None

    Description

      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:

      --- 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"/>
      

      Attachments

        Activity

          People

            ggregory Gary D. Gregory
            erikkemperman Erik Kemperman
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: