What I do is reference a property that I know my web application will set up for me upon application startup that is uniquely named, but predictable. For instance, if your webapp context is named "MyApp", then you'd reference ${MyApp.log.home} and create this property *before* manually configuring log4j.

I set up code to generate the system property and value automatically in the log4j-sandbox. I suggest grabbing the alpha2 or alpha3 tag if you want a codebase that will compile and deploy against Log4j 1.2.x. See my latest updates to the following wiki entry....

http://wiki.apache.org/logging-log4j/AppContainerLogging


Jake

At 03:41 PM 6/12/2007, you wrote:
>Hi,
>
>I am using log4j for my webapp logging (a servlet in a war file name
>'test.war').
>
>The current location of my log files are:
>log4j.appender.DEBUG.File=${catalina.base}/debug.log
>
>How can I change it so that it will be put under the directory of my
>webapp (e.g. tomcat will create directory 'test' for my 'test.war').
>Is there a variable that I can use?
>
>i.e. something like:
>log4j.appender.DEBUG.File=${catalina.base}/${web-app-directory}/debug.log
>
>Thank you.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to