where to place the log4j.properties file
1 posts in topic
Flat View  Flat View

Posted By:   sangeetha_Rao
Posted On:   Monday, January 30, 2006 02:29 AM

I am using log4j in my J2EE application. We use RAD for our development and the application server is WAS 6.0. We used to place the log4j.properties in the properties folder of the application server and it was working fine. But now we are asked to put the properites file with in the application EAR itself. How to do that ?

Re: where to place the log4j.properties file

Posted By:   Jani_Kaarela  
Posted On:   Tuesday, January 31, 2006 03:10 AM

I can't be bothered to check this (I got to, you know, work), but IIRC Log4j looks for the property file in the classpath. In an EAR file, there are several classloaders, each with it's own classpath - I recommend you do some googling and/or check WAS docs to learn about the classpath hierarchy. You have at least two options:

  1. In your EAR file's MANIFEST, put a Classpath entry which points (using a path relative to EAR root) to the property file, placed inside the EAR.

  2. Place the property file in a WAR's WEB-INF/lib directory - but be warned that it will not be visible to others WARs and EJBs.

About | Sitemap | Contact