Hi, This question is routinely addressed on the tomcat-user mailing list: you may wish to search that list's archives for the myriad approaches and solutions that people have proposed over the years.
Common ones include: - NOT to use a relative filename, as the definition of Current Working Directory is far from portable, - Use Ant tokens in your configuration files (if you use a log4j configuration file) and substitute appropriate values when packaging/deploying your webapp - Use System Properties (e.g. ${CATALINA_HOME}/logs/myLog.txt) -- this approach is frequently suggested on this list and examples/discussion are in the archives - Use a env-entry/env-entry-ref combination: while this is the most heavyweight, it's also the most portable and most in line with the J2EE spec, leaving it up to the server admin to tell your webapp where to log. Yoav Shapira Millennium Research Informatics >-----Original Message----- >From: Stephen Pain [mailto:[EMAIL PROTECTED] >Sent: Wednesday, May 26, 2004 5:54 AM >To: Log4J Users List >Subject: Re: FileAppender file path in a web app > > >Keith, > >When we deploy to our managed hosting service, they tell us to use >"../logs/filename.log" - obviously this doesn't guarantee that the same >will work for you, but it does demonstrate that relative filenames work! > >Unfortunately I don't have access to tell you exactly where ../ points to, >but your hosting service might be able to suggest a similar location? > >Cheers, >Stephen > > > > > "Keith Rogers" > <[EMAIL PROTECTED] To: <log4j- >[EMAIL PROTECTED]> > arkman.com> cc: > Subject: FileAppender >file path in a web app > 26/05/2004 10:19 > Please respond to > "Log4J Users List" > > > > > > >How would I specify a path for file appenders to use in a web-app? I can >specify an absolute path, but while this is fine on my development >server, it will be a problem when I deploy to the hosting service we >use, as I don't know what the file structure is above our application >directory. What I'd really like is to just be able to specify >/web-inf/logs/debug.log > >I've tried using relative filenames, but this does not seem to work. > > >The information in this e-mail is confidential and intended to be solely >for the use of the addressee(s) and may contain copyright and/or legally >privileged information. If you are not the addressee (or responsible for >delivery of the message to the addressee) please e-mail us at >[EMAIL PROTECTED] and delete the message from your computer; >copying, distribution, use or disclosure of its contents is strictly >prohibited. >As Internet communications are capable of data corruption no responsibility >is accepted for changes made to this message after it was sent. For this >reason it may be inappropriate to rely on advice contained in any e-mail >without obtaining written confirmation of it. >In addition, no liability or responsibility is accepted for viruses and it >is your responsibility to scan attachments (if any). >Please note that for business purposes, outgoing and incoming emails from >and to the company may be monitored and recorded. > >Mouchel Parkman UK Ltd, Registered in England at West Hall, Parvis Road, >West Byfleet, Surrey UK KT14 6EZ Registered No : 1686040 > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > >-- > >This e-mail may contain confidential and/or privileged information. If you >are not the intended recipient (or have received this e-mail in error) >please notify the sender immediately and destroy this e-mail. Any >unauthorized copying, disclosure or distribution of the material in this e- >mail is strictly forbidden. > > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]