The best you can do to place your property file in any directory that contains to the classpath (e.g. WEB-INF/classes ...) and load the file via the VM:
E.G. Tomcat in Catalina.bat
set CATALINA_OPTS=%CATALINA_OPTS% -Dlog4j.configuration=log4jxy.properties
(dont take log4j.properties, take another name)
Nothing more have to be done. At the first demand of a logger, log4j itsselft reads the propterty file.
e.g. common logger you have to put this line in your code:
private Log trace = Log4jFactory.getLog(this.getClass());
Manfred
Dan Allen wrote:
I promise you I researched this, hence why you will find that this is an intelligible question.
If I make a log4j.properties file and I want to place it in the WEB-INF/classes/resources directory (in the spirit of Ted Husted) do I have to then create a custom servlet Log4jInit to load this properties file and define it in the web.xml file? I found information on the custom servlet in the Log4j manual and it looks to be the same exact servlet that is used to initialize Torque in the stocktrack application in the Struts KickStart book.
In short, it would seem to me that if I move the file from
WEB-INF/classes
to
WEB-INF/classes/resources
I have to make a custom servlet. Is this an incorrect assumption and if not, how do I tell the web container where to find it (surely it doesn't go hunting throughout the whole classpath).
Dan
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]