logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <h...@visi.com>
Subject Re: How to use relative filename in log4j.properties?
Date Tue, 07 Feb 2006 17:06:33 GMT

I second James' suggestion.  However, if you really want to use relative paths,
then you need to know what directory the VM is starting from.  This depends on
how you are starting Tomcat.  I'll assume you are using plain vanilla Tomcat,
not Tomcat bundled with JBoss or some other such package.

If you are starting using the .bat or .sh files, then (unless something's
changed recently), the VM should start from the CATALINA_HOME/bin directory. 
So, in your config file, you could refer to the logs directory using...

../logs/some.log

However, if you are using something like the Windows service, this does not
start the VM from the CATALINA_HOME/bin directory, but from the
C:\WINNT\system32 directory (You'll have to double check this, but I think this
is the default for Windows).  You can solve this issue by adding the following
to service.bat and then do a "service remove" and then "service install"...

set PR_STARTPATH=%CATALINA_HOME%\bin
set PR_STOPPATH=%CATALINA_HOME%\bin

That will normalize behavior to be equivalent to running from the .bat or .sh
files.


Jake

Quoting James Stauffer <stauffer.james@gmail.com>:

> Use something like:
> ${catalina.home}/logs/some.log
>
> On 2/7/06, Zsolt <zkoppanylist@intland.com> wrote:
> > Hi,
> >
> > I use logging-log4j-1.2.13 from tomcat-5.5.15. How can I use relative
> > filenames to get the log files under tomcat/logs?
> >
> > Zsolt
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
>
>
> --
> James Stauffer
> Are you good? Take the test at http://www.livingwaters.com/good/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>




---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message