You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Ralph Goers (JIRA)" <ji...@apache.org> on 2014/08/27 19:35:59 UTC

[jira] [Commented] (LOG4J2-804) XInclude does not respect classpath

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

Ralph Goers commented on LOG4J2-804:
------------------------------------

The nature of XInclude is that it just embeds the XML into the file wherever the XInclude resides. Allowing Multiple Logger and/or Appender sections to allow multiple XIncludes is not the way I would favor implementing this. See LOG4J2-494 for how I would prefer to handle this.

> XInclude does not respect classpath
> -----------------------------------
>
>                 Key: LOG4J2-804
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-804
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Configurators
>            Reporter: Alex Barnes
>
> This issue is related to the one resolved by https://issues.apache.org/jira/browse/LOG4J2-341
> The <xi:include> element does not respect entries provided on the classpath. 
> Specific use case: I have a log4j2.xml configuration I wish to share across several applications providing a common base of appenders and plugins, these are bundled into a myorg-logging.jar to be used in downstream projects that wish to provide configuration for their loggers. In the myorg-logging log4j2.xml I wish to optionally include a file from the classpath called myorg-logging.xml
> == log4j2.xml ==
> <Loggers>
>   <logger name="root" level="env:rootLogLevel:-WARN"/>
>   <logger name="my.org" level="env:myOrgLogLevel:-INFO"/>
>   <xi:include href="myorg-logging.xml">
>     <xi:fallback/>
>   </xi:include>
> </Loggers>
> I also noticed once a Loggers or Appenders section has been declared in xml, it can not be appended to with a second Loggers or Appenders section (which would be nice for a top level additive xi:include scenario instead of limiting to an included file just for loggers, a file just for appenders, etc)



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org