Hi,

My application 'src' directory contains three sub-folders:

- com.mypackage.ejb
- com.mypackage.strut
- com.mypackage.utils

I want to use log4j and log the messages from the files in the above 3 folders.

The application is deployed as .ear in JBoss.

In my build.xml, before creating .jar, .war, .ear, I have the following:

 <copy file="${PROJ_LIB}/log4j.properties" 
    tofile="${BLD_EJB_DIR}/com/mypackage/strut/log4j.properties"/>

Above line bascially copies log4j.properties file into 
WEB-INF/classes/com/mypackage/strut folder.

And in a .java file in 'com.mypackage.strut' folder, I am using:

PropertyConfigurator.configure("log4j.properties");

And this is working.

But I want log4j.properties to be accessible to the files in all the three folders. 
So, I should placc it in "WEB-INF/classes" folder instead of placing it in 
"WEB-INF/classes/com/mypackage/strut" folder.

When I place it in "WEB-INF/classes/com/mypackage/strut" folder, it's accessible to 
all classes in 'strut' sub-folder only.

I think I need to specify the full path of the file while using PropertyConfigurator. 
How to specify full path? Can someone please suggest?

Sriram








Reply via email to