You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Stefano Maioli (Jira)" <ji...@apache.org> on 2022/01/19 10:14:00 UTC
[jira] [Created] (LOG4J2-3350) Routing appender does not expand nested variables
Stefano Maioli created LOG4J2-3350:
--------------------------------------
Summary: Routing appender does not expand nested variables
Key: LOG4J2-3350
URL: https://issues.apache.org/jira/browse/LOG4J2-3350
Project: Log4j 2
Issue Type: Bug
Components: Appenders
Affects Versions: 2.17.1
Reporter: Stefano Maioli
Routing appender does not expand anymore nested variables.
Using the configuration below, Log4J version 2.14.0 create correctly the file {*}C:\tmp\test.log{*}, but from Log4J version 2.17.0 the property expansion doesn't work anymore and a wrong file *${drive}${path}${name}* is written in the current working directory.
{code:java}
<Properties>
<Property name="pcode">def</Property>
<Property name="drive">C:</Property>
<Property name="path">/tmp/</Property>
<Property name="name">test.log</Property>
<Property name="filename">${drive}${path}${name}</Property>
<Property name="filepattern">${filename}.%i.backup</Property>
</Properties>
<Appenders>
<Routing name="Routing">
<Routes pattern="$${map:pcode}">
<Route>
<RollingFile name="Rolling" fileName="${filename}" filePattern="${filepattern}">
<PatternLayout>
<pattern>%map{data}%n</pattern>
</PatternLayout>
<SizeBasedTriggeringPolicy size="500" />
</RollingFile>
</Route>
</Routes>
</Routing>
</Appenders>
{code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)