You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by "Shapira, Yoav" <Yo...@mpi.com> on 2002/11/01 19:34:50 UTC

RE: Specifying default configuration file for Tomcat

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

Yoav Shapira
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
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>


Re[2]: Specifying default configuration file for Tomcat

Posted by Jacob Kjome <ho...@visi.com>.
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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Specifying default configuration file for Tomcat

Posted by "Bradley M. Handy" <bh...@arbor.edu>.
That helps.  I don't remember it saying that in the documentation.  I wasn't sure if I was specifying a resource or file path.  Thank you for your help.

Brad Handy

-----Original Message-----
From: Shapira, Yoav [mailto:Yoav.Shapira@mpi.com]
Sent: Friday, November 01, 2002 1:35 PM
To: Log4J Users List
Subject: RE: Specifying default configuration file for Tomcat

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

Yoav Shapira
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
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>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>