You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@logging.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2017/07/20 18:56:00 UTC

[jira] [Commented] (LOG4J2-1982) Log4j-config.xsd only allows one AppenderRef element for each Logger element

    [ https://issues.apache.org/jira/browse/LOG4J2-1982?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16095195#comment-16095195 ] 

ASF subversion and git services commented on LOG4J2-1982:
---------------------------------------------------------

Commit aabb33971bdde1f74679384f992fc2035013906c in logging-log4j2's branch refs/heads/master from [~garydgregory]
[ https://git-wip-us.apache.org/repos/asf?p=logging-log4j2.git;h=aabb339 ]

[LOG4J2-1982] Log4j-config.xsd only allows one AppenderRef element for
each Logger element.

> Log4j-config.xsd only allows one AppenderRef element for each Logger element
> ----------------------------------------------------------------------------
>
>                 Key: LOG4J2-1982
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1982
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Configurators
>    Affects Versions: 2.8.2
>         Environment: Alle environments
>            Reporter: Christoph Lembeck
>
> The xsd schema definition for the log4j configuration allow only one AppenderRef per Logger. The definition of the Logger element is as follows
> {code:xml}
> <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>
> {code}
> Comparing this to the Definition of the root Logger we see a sequence of multiple Appender
> Ref elements to be allowed.
> {code:xml}
> <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>
> {code}
> 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.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)