Thomas Hackel created LOG4J2-2951:
-------------------------------------
Summary: Properties are not resolved with Log4J1 configuration
Key: LOG4J2-2951
URL: https://issues.apache.org/jira/browse/LOG4J2-2951
Project: Log4j 2
Issue Type: Bug
Components: log4j 1.2 emulation
Affects Versions: 2.13.3
Reporter: Thomas Hackel
When using the log4j 1.2 emulation, the resolution of variables in the
log4j.properties does not work.
{code:java}
...
maxbackupindex=20
log4j.appender.RFA=org.apache.log4j.RollingFileAppender
log4j.appender.RFA.MaxBackupIndex=${maxbackupindex}
...
{code}
I've also created a sample project which shows the problem:
[https://github.com/thackel/log4j2-legacy-test]
The log4j1 initialization (using system property) works and the property file
is read automatically from the classpath, just the variable substitution does
not work.
Whats interesting that there is an existing Testcase in Log4J, which shows that
it somehow works:
[Log4j1ConfigurationFactoryTest.java
|https://github.com/apache/logging-log4j2/blob/log4j-2.13.3/log4j-1.2-api/src/test/java/org/apache/log4j/config/Log4j1ConfigurationFactoryTest.java#L159]with
its
[log4j.properties|https://github.com/apache/logging-log4j2/blob/log4j-2.13.3/log4j-1.2-api/src/test/resources/config-1.2/log4j-RollingFileAppender-with-props.properties].
--
This message was sent by Atlassian Jira
(v8.3.4#803005)