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 "Thiago Kronig (JIRA)" <ji...@apache.org> on 2015/03/11 16:45:38 UTC
[jira] [Commented] (LOG4J2-950) Incorrect attribute name in
PropertiesRewritePolicy example
[ https://issues.apache.org/jira/browse/LOG4J2-950?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14357066#comment-14357066 ]
Thiago Kronig commented on LOG4J2-950:
--------------------------------------
Done, tks!
> Incorrect attribute name in PropertiesRewritePolicy example
> -----------------------------------------------------------
>
> Key: LOG4J2-950
> URL: https://issues.apache.org/jira/browse/LOG4J2-950
> Project: Log4j 2
> Issue Type: Bug
> Components: Documentation
> Affects Versions: 2.1
> Reporter: Joel Edwards
> Priority: Minor
> Fix For: 2.2
>
>
> http://logging.apache.org/log4j/2.0/manual/appenders.html#RewriteAppender
> On the documentation site on the _Appenders_ page, under the _RewriteAppender_ heading, _RewritePolicy_ section, _PropertiesRewritePolicy_ subsection, there is the following example:
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <Configuration status="warn" name="MyApp" packages="">
> <Appenders>
> <Console name="STDOUT" target="SYSTEM_OUT">
> <PatternLayout pattern="%m%n"/>
> </Console>
> <Rewrite name="rewrite">
> <AppenderRef ref="STDOUT"/>
> <PropertiesRewritePolicy>
> <Property key="user">${sys:user.name}</Property>
> <Property key="env">${sys:environment}</Property>
> </PropertiesRewritePolicy>
> </Rewrite>
> </Appenders>
> <Loggers>
> <Root level="error">
> <AppenderRef ref="Rewrite"/>
> </Root>
> </Loggers>
> </Configuration>
> {code}
> The {{Configuration -> Appenders -> Rewrite -> PropertiesRewritePolicy -> Property}} nodes in the example are using an attribute with the name {{key}}. When tested in log4j 2.1, this did not work. However, using the attribute {{name}} did work.
> *From the Documentation*
> {code:xml}
> <PropertiesRewritePolicy>
> <Property key="user">${sys:user.name}</Property>
> <Property key="env">${sys:environment}</Property>
> </PropertiesRewritePolicy>
> {code}
> *Working Version*
> {code:xml}
> <PropertiesRewritePolicy>
> <Property name="user">${sys:user.name}</Property>
> <Property name="env">${sys:environment}</Property>
> </PropertiesRewritePolicy>
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org