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 red phoenix <ro...@gmail.com> on 2006/03/14 07:06:46 UTC

How to get Log4j configure file under Tomcat?

I have a ordinary Java class,not a servlet class,it locates the directory of
tomcat\webapps\test\WEB-INF\classes\test\testing.class,it will read a
configure file,the configure file locates
tomcat\webapps\test\WEB-INF\conf\test.configure. My question is how to get
real path of configure file,because tomcat may install C Disk or D Disk,or
installed under Windows or Linux OS.

Any idea will be appreciated!
Edward

Fwd: How to get Log4j configure file under Tomcat?

Posted by James Stauffer <st...@gmail.com>.
Kaya had a better suggestion.

---------- Forwarded message ----------
From: volkanka <vo...@oksijen.com>
Date: Mar 14, 2006 8:27 AM
Subject: RE: How to get Log4j configure file under Tomcat?
To: stauffer.james@gmail.com



getServletContext().getResourceAsStream("/conf/test.configure");

regards.

-----Original Message-----
From: James Stauffer [mailto:]
Sent: Tuesday, March 14, 2006 3:17 PM
To: Log4J Users List
Subject: Re: How to get Log4j configure file under Tomcat?

Can you move the config file to something under
tomcat\webapps\test\WEB-INF\classes?  Then you could get the path
throught the testing.class ClassLoader.

On 3/14/06, red phoenix <ro...@gmail.com> wrote:
> I have a ordinary Java class,not a servlet class,it locates the directory
of
> tomcat\webapps\test\WEB-INF\classes\test\testing.class,it will read a
> configure file,the configure file locates
> tomcat\webapps\test\WEB-INF\conf\test.configure. My question is how to get
> real path of configure file,because tomcat may install C Disk or D Disk,or
> installed under Windows or Linux OS.
>
> Any idea will be appreciated!
> Edward
>
>


--
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org



--
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: How to get Log4j configure file under Tomcat?

Posted by James Stauffer <st...@gmail.com>.
Can you move the config file to something under
tomcat\webapps\test\WEB-INF\classes?  Then you could get the path
throught the testing.class ClassLoader.

On 3/14/06, red phoenix <ro...@gmail.com> wrote:
> I have a ordinary Java class,not a servlet class,it locates the directory of
> tomcat\webapps\test\WEB-INF\classes\test\testing.class,it will read a
> configure file,the configure file locates
> tomcat\webapps\test\WEB-INF\conf\test.configure. My question is how to get
> real path of configure file,because tomcat may install C Disk or D Disk,or
> installed under Windows or Linux OS.
>
> Any idea will be appreciated!
> Edward
>
>


--
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org