Hi Thomas,
Thanks for your reply. My appln will be a war file deployed in the appln
server, web container.If i didn't give any directory name to log file,
as of now it creates the log file under /j2ee/home/test.log. 1. My first issue is, how does it gets this path, based on what  system parameter
it takes up this value /j2ee/home/ and prepend it to log file ?
2. If i know the system property i need to set, i can set that to log file
location or i can append to the result of qstn 1. The idea is, if there
is a system prop that FileAppender picks it up, i can override that by a
new value as soon as the property is loaded

-Balaji



Thomas Muller wrote:

| 1. How do i specify a relative path to this file name, so that it can be
| created under j2ee/home/log/test.log. This j2ee/home may be under some
| other top level dir ?

Before log4j is configured, insert the application server home path in the
System properties, e.g.

System.setProperty( "j2ee.home", <path>" )

Then insert your relative part in another property

System.setProperty( "my.log.files", <relative path>" )

Now you can use Log4j's standard variable interpolation support in your
config file:

log4j.appender.R.File=${j2ee.home}/{my.log.files}/test.log

| 2. If i just specify any relative path in the property file, its not
| creating the log ?

It will, but (probably) relative to the System variable "user.dir".

--

Thomas





*************************************************************************
Copyright ERA Technology Ltd. 2002. (www.era.co.uk). All rights reserved. The information supplied in this Commercial Communication should be treated
in confidence.
No liability whatsoever is accepted for any loss or damage suffered as a result of accessing this message or any attachments.

________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information on a proactive anti-virus service working
around the clock, around the globe, visit http://www.messagelabs.com
________________________________________________________________________

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



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

Reply via email to