You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Christoph Wagner <cw...@canto.de> on 2003/04/25 14:35:50 UTC
Suggestion for log4x.xml keywords
Hi,
I'm using log4j since a few months and I thinks it's a great tool. But one
problem still existing is the handling of relative file names in the
log4j.xml file.
If I deploy my application in a structure like the following
/bin
/logs
and my log4.xml laying under /bin references a log file as
"../logs/mylog.log" I have to make sure, that the JVM always uses /bin as
working directory. That is not a problem if I am my own start scripts but it
is a problem if the application is deployed into a 3rd party container.
AFAIK the proposed solution to this problem is to use a system property
like:
<param name="File" value="${APP_HOME}/logs/mylog.log"/>
and set the system property APP_HOME to my installation directory.
But this isn't always a working solution, because you aren't always able
(read: allowed) to set system properties for a container or maybe you don't
want to introduce another variable into the installation process.
Therefore I suggest the introduction of log4j keywords. To solve the problem
described earlier it would be great to be able to use a term like
<param name="File" value="${log4j.config.location}/../logs/mylog.log"/>
Another possible solution would be another attribute for the tag like
<param name="File" value="../logs/mylog.log" relativeToConfigFile="true" />
The implementation of one of these solutions would enable developers to ship
their applications with a ready-to-tun log4j.xml. It would also greatly
simplify the installion / deployment of applications.
It would be great to have such a feature in one of the upcoming releases.
Thanks in advance
Christoph Wagner
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-dev-help@jakarta.apache.org