You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2021/12/05 20:12:00 UTC

[jira] [Commented] (LOG4J2-2951) Properties are not resolved with Log4J1 configuration

    [ https://issues.apache.org/jira/browse/LOG4J2-2951?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17453669#comment-17453669 ] 

ASF subversion and git services commented on LOG4J2-2951:
---------------------------------------------------------

Commit 67cdd9996bdd2bf53178c66000af0a17cf98152a in logging-log4j2's branch refs/heads/release-2.x from Ralph Goers
[ https://gitbox.apache.org/repos/asf?p=logging-log4j2.git;h=67cdd99 ]

LOG4J2-2951 - Log4j 1.x properties were not being substrituted.


> 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
>            Assignee: Ralph Goers
>            Priority: Major
>
> 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.20.1#820001)