Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.8.2
-
None
-
Alle environments
Description
The xsd schema definition for the log4j configuration allow only one AppenderRef per Logger. The definition of the Logger element is as follows
<xs:complexType name="LoggerType"> <xs:sequence> <xs:choice minOccurs="0" maxOccurs="1"> <xs:element name="Filters" type="FiltersType"/> <xs:element name="Filter" type="FilterType"/> </xs:choice> <xs:element name="AppenderRef" type="AppenderRefType"/> </xs:sequence> <xs:attribute name="name" type="xs:string" use="required"/> <xs:attribute name="level" type="xs:string" use="optional"/> <xs:attribute name="additivity" type="xs:string" use="optional"/> </xs:complexType>
Comparing this to the Definition of the root Logger we see a sequence of multiple Appender
Ref elements to be allowed.
<xs:complexType name="RootType"> <xs:sequence> <xs:element name="AppenderRef" type="AppenderRefType" minOccurs="1" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="level" type="xs:string"/> </xs:complexType>
With this configuration it is not possible to define a specific Logger, that shows infos and errors to the console and writes only the errors in a log file, since there can only be one appender defined for that logger.
Please modify the xsd file to allow mutliple AppenderRef elements per Logger.
Attachments
Issue Links
- is related to
-
LOG4J2-2073 Log4j-config.xsd should make AppenderRef optional for each Logger element
-
- Closed
-