[
https://issues.apache.org/jira/browse/LOG4J2-378?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13754100#comment-13754100
]
Eric Schwarzenbach commented on LOG4J2-378:
-------------------------------------------
Sorry is it really is just "${sys" and not "${sys." I must have made a cut and
paste error.
> Is it possible for you to just add the -Dapplication-name to setenv.sh?
No, because there are multiple webapps on the server. The actual purpose behind
what I am doing is to have multiple apps, even multiple copies of this
particular app (copies of same war deployed with different names as different
apps) each logging to files prefixed with the webapp name to make them
distinguishable.
It seems not unlikely that one or more version of tomcat just has a bug that
causes it to run these methods in the wrong order. And I can explore that and
pursue getting a newer version installed. However I want to address those two
broader issues first, since I might have to change how I'm doing this in a way
that this becomes moot:
1) what really does the servlet spec dictate should happen here? (See the last
para of me previous comment...what does "according to the interfaces they
implement" mean?
2) If the spec does dictate something about the order that log4j can
control...should the log4j contextInitialized come first?
If so then what I'm trying to do won't work...the fact that it works on one
server is itself the bug. In which case is there some other way I can
accomplish this? I realize that is kind of outside the scope of this bug,
except that the consideration of making use cases like this one impossible
could be a consideration for answering or reconsidering question 2.
> Logging generates file named ${sys on some systems
> --------------------------------------------------
>
> Key: LOG4J2-378
> URL: https://issues.apache.org/jira/browse/LOG4J2-378
> Project: Log4j 2
> Issue Type: Bug
> Affects Versions: 2.0-beta8
> Environment: Issues occurs on Win7/64 system under Tomcat 7.0.42 /
> Oracle JDK 1.7.0_25; fails to occur on RHEL 5.2 system under Tomcat 7.0.26 /
> Oracle JDK 1.7.0_03
> Reporter: Eric Schwarzenbach
>
> In a webapp I'm setting a system property in my apps ServletContextListener,
> and using that system property in my log4j2.xml file, like so:
> {code}
> <appender type="FastFile" name="File"
> fileName="${sys:catalina.home}/logs/${sys:application-name}.log">
> {code}
> On my Windows machine, a log file named "${sys." (always 0 bytes) is being
> created instead of a log file with the application-name. The same war
> deployed on one of our linux servers does not create a ${sys." file and
> instead creates a log file with the intended application-name.
> I should note that the files DO appear in the directory that
> sys:catalina.home should resolve to. They appear elsewhere when I don't use
> sys:catalina.home so I'm quite sure that this variable is resolving correctly
> and it is the sys:application-name which is the problem.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]