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[2]: Specifying default configuration file for Tomcat
Date Fri, 01 Nov 2002 20:15:48 GMT
Hello Yoav,

That implies loading it via a File object which is not guaranteed to
work in a servlet environment because you can't control whether your
app is loaded off the filesystem or directly from a .war file.  Load
it as a resource, not as a file.

InputStream stream = this.getClass().getResourceAsStream("foo.txt");

Or, just store it in WEB-INF and do:

InputStream is = getServletContext().getResourceAsStream("/WEB-INF/foo.txt");


That is portable in *all* cases.

Jake

Friday, November 01, 2002, 12:34:50 PM, you wrote:

SY> Hi,
SY> You're specifying the path to a file.  Use the File.separator for your
SY> system.  On Unix, that / normally, and on windows \.  

SY> Yoav Shapira
SY> Millennium ChemInformatics


>>-----Original Message-----
>>From: Bradley M. Handy [mailto:bhandy@arbor.edu]
>>Sent: Friday, November 01, 2002 1:36 PM
>>To: log4j-user@jakarta.apache.org
>>Subject: Specifying default configuration file for Tomcat
>>
>>I've read the short manual, and I've seen how to specify the default
>>configuration file when starting Tomcat.  However, I was wondering if
SY> my
>>configuration file is a couple of directory levels down from "WEB-
>>INF/classes", which notation should I use:
>>
>>       Dot notation:   "dir1.dir2.config-file.properties"
>>       Slash notation: "dir/dir2/config-file.properties" (Unix)
>>"dir1\dir2\config-file.properties" (Windows)
>>
>>Could someone please enlighten me?
>>
>>Thanks.
>>
>>Bradley M. Handy
>>Programmer/Analyst
>>Spring Arbor University
>>
>>mailto:bhandy@arbor.edu
>>
>>
>>
>>--
>>To unsubscribe, e-mail:   <mailto:log4j-user-
>>unsubscribe@jakarta.apache.org>
>>For additional commands, e-mail: <mailto:log4j-user-
>>help@jakarta.apache.org>




-- 
Best regards,
 Jacob                            mailto:hoju@visi.com


--
To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>


Mime
View raw message