You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Ralph Goers (JIRA)" <ji...@apache.org> on 2018/11/07 15:18:00 UTC
[jira] [Commented] (LOG4J2-2500) Property substitution not working
if tag is not placed at the beginning of configuration
[ https://issues.apache.org/jira/browse/LOG4J2-2500?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16678370#comment-16678370 ]
Ralph Goers commented on LOG4J2-2500:
-------------------------------------
This is intentional. Looking at the documentation for property substitution this needs to be explicitly stated.
> Property substitution not working if <Properties> tag is not placed at the beginning of configuration
> -----------------------------------------------------------------------------------------------------
>
> Key: LOG4J2-2500
> URL: https://issues.apache.org/jira/browse/LOG4J2-2500
> Project: Log4j 2
> Issue Type: Documentation
> Components: Core
> Affects Versions: 2.11.1
> Environment: Any project with log4j using as configuration a file like the one attached as example.
> With this configuration, logs will be printed as ${defaultLayout} instead of the actual message.
> Reporter: Javier Armendáriz
> Priority: Minor
> Labels: configuration, xml
> Attachments: log4j2.xml
>
>
> Tweaking my log configuration I found out that if the <Properties> is not placed at the beginning of the config just after the <Configuration> tag, the property substitution is not performed at all.
> Looking at the documentation I haven't seen anything related to the ordering of the elements in the config files. If there's a good reason that the properties should be placed first place in configuration, it'd be a good idea to note it somewhere in the documentation.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)