[
https://issues.apache.org/jira/browse/LOG4J2-3328?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17480304#comment-17480304
]
Paul Cooper commented on LOG4J2-3328:
-------------------------------------
Gary,
I pulled the latest snapshot build from the link above, and it appears your fix
is working correctly.
Thank you for your quick response.
Do you have any idea when 2.17.2 will get rolled out?
Paul
> Log4j 1.2 bridge does not support system properties in log4j.xml
> ----------------------------------------------------------------
>
> Key: LOG4J2-3328
> URL: https://issues.apache.org/jira/browse/LOG4J2-3328
> Project: Log4j 2
> Issue Type: Bug
> Components: Log4j 1.2 bridge
> Affects Versions: 2.17.1
> Environment: {{Windows 10}}
> {{Amazon Linux}}
> Reporter: Paul Cooper
> Assignee: Gary D. Gregory
> Priority: Blocker
> Fix For: 2.17.2
>
>
> I am attempting to use the log4j bridge with log4j2, and cannot use system
> properties to set a location for my log files.
> Reported here:
> [stackoverflow|https://stackoverflow.com/questions/70628593/system-property-not-being-read-by-log4j2-lo4j1-bridge]
> My log4j.xml file:
> {{log4j-dev.xml}}
> {{...}}
> {{<appender name="DAILY" class="org.apache.log4j.RollingFileAppender">}}
> {{<param name="File" value="${catalina.base}/logs/etl.log"/>}}
> {{<param name="DatePattern" value="'.'yyyy-MM-dd"/>}}
> {{<layout class="org.apache.log4j.PatternLayout">}}
> {{<param name="ConversionPattern" value="GATEWAY: %p %d [%t] %c\{1}.%M(%L) |
> %m%n"/>}}
> {{</layout>}}
> {{</appender>}}
> {{...}}
> The setenv.bat entry where I define which log4j.xml to use:
> {{-Dlog4j2.debug=true -Dlog4j.configuration=log4j-dev.xml}}
> The properties shown in the tomcat log illustrating that the system property
> in question is being supplied to the log4j1 bridge
> {{...}}
> {{Command line argument: -Dlog4j2.debug=true}}
> {{Command line argument: -Dlog4j.logDir=C:\dev\apache-tomcat-8.5.50\logs}}
> {{Command line argument: -Dlog4j.configuration=log4j-dev.xml}}
> {{Command line argument: -Dcatalina.base=C:\dev\apache-tomcat-8.5.50}}
> {{Command line argument: -Dcatalina.home=C:\dev\apache-tomcat-8.5.50}}
> {{Command line argument: -Djava.io.tmpdir=C:\dev\apache-tomcat-8.5.50\temp}}
> {{...}}
> And the part of the log that shows where the log file is successfully created
> and what path it is using:
> {{...}}
> {{DEBUG StatusLogger Class name: [org.apache.log4j.RollingFileAppender]}}
> {{DEBUG StatusLogger Parsing layout of class:
> "org.apache.log4j.PatternLayout"}}
> {{DEBUG StatusLogger PluginManager 'Converter' found 47 plugins}}
> {{TRACE StatusLogger New file '${catalina.base}/etl.log' created = true}}
> {{DEBUG StatusLogger Returning file creation time for
> C:\dev\apache-tomcat-8.5.50\bin\${catalina.base}\etl.log}}
> {{DEBUG StatusLogger Starting RollingFileManager ${catalina.base}/etl.log}}
> {{...}}
> The log file is being created in a folder named "${catalina.base}", in
> whatever directory I'm in when I start tomcat. The issue is similar to this
> Jira issue, LOG4J2-2951, and that issue was just resolved in early December.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)