I have created a wrapper class for the log4j, so that my application remains oblivious of the logging API (which might change in the future for us). My project structure is as such: EJBProject -- ejb stuff WEBProject -- web stuff JAVAProject-- all other java classes.
I wanna implement logging across all of them. For this, I have copied the log4j.1.2.8.jar file into the WEB-INF/lib and I have the log4j.properties in the WEBProject/Java Source folder. My wrapper class is in JAVAProject.
Extra Questions : 1)What is the proper way to create dependencies in such a scenario? 2)Where would I put my log4j.properties file and the log4j1.2.8.jar file so that all projects can have access to it? Currently I have added the log4j1.2.8.jar file in the JAVAProject's Libraries too. When I execute my filter it gives me the following error :
Why would it even look for Category?? I thought that class was deprecated and replaced by Logger. BTW line no 34 where the error occurs in my filter is this
I found that if i move my wrapper class to the WEBProject then the logging works for the classes/servlets in the WEBProject. I cannot import any classes from the WEBProject to my JAVAProject since the dependency hierarchy is not defined that way.
my JAVAProject cannot have any dependency on the EJB and WEB projects and anyway my Log-Wrapper should technically be in the JAVAProject. What would be the work-around? How should I put my classes/log4j.properties file/log4jjar file so that everything works fine?