[
https://issues.apache.org/jira/browse/LOG4J2-3258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17463071#comment-17463071
]
Konstantinos Liakos commented on LOG4J2-3258:
---------------------------------------------
Half of my problem was solved by using single dollar sign for the ENV: var in
the <Property> declaration, as per [~rgoers] recommendation.
The other half, which I hadn't mention in order to keep the example simple, is
that I have a $${bundle:app:serviceName} <Property> declaration, which also
stopped working. This one was solved as per the [~ckozak] recommendation, so I
explicitly added the bundle: variable with a single dollar sign in the fileName
attribute of RollingFile and it is resolved fine. I would expect though that
since this is also pretty much a static value, it would be resolved on config
init once if I declare it with a <Property>.
> RollingFile fileName containing variables does not work on 2.17.0
> -----------------------------------------------------------------
>
> Key: LOG4J2-3258
> URL: https://issues.apache.org/jira/browse/LOG4J2-3258
> Project: Log4j 2
> Issue Type: Bug
> Components: Appenders
> Affects Versions: 2.17.0
> Environment: Java 17, Ubuntu 20.04.
> Reporter: Konstantinos Liakos
> Priority: Major
> Attachments: log4j2-appender-routing.xml, log4j2.xml
>
>
> A configuration like the below has stopped working since 2.17.0. The
> variables that originate from <Properties> are not resolved to their actual
> values.
> {code:xml}
> <Property name="logs_dir">$${env:LOGS_DIRECTORY}</Property> {code}
> {code:xml}
> <RollingFile name="Rolling-${ctx:logFile}"
> fileName="${logs_dir}/${ctx:logFile}"{code}
>
> Works fine on 2.16.0.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)