log4j implementation

2002-09-21 Thread kumar kumar

Dear Sir/Madam,

I am working on J2EE project.There i am using different design 
pattern in J2EE application.
1. Business Delegate
2. Session Bean/Entity Bean
3. DAO
4. Database

I am interested to use log4j. Please can you clarify me how  can i 
handle exception and log them using log4j.
1. How i can configure the log4j?
2. Where should i place log4j.properties file?
3. Can i change the name of log4j.properties file?

Thanks & Regards
Kumar


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




log4j.jar locked by Tomcat even after remove/undeploy....

2002-09-21 Thread Jacob Kjome


This issue has been brought up before with no response

I use Tomcat-4.1.11 and the manager app to install/remove | deploy/undeploy 
| start/stop my webapp which contains log4j-1.2.6.jar in WEB-INF/lib.  What 
I'd like to be able to do is uninstall or undeploy the webapp and run a 
clean build.  However, whenever I do this the build fails because it cannot 
delete the log4j jar file.  I've used LogManager.shutdown() in a 
ServletContextListener which will get run upon being notified that the app 
is shutting down.  This does not helpwell, it does help in unlocking 
the log file that gets written while the webapp is running which gets 
written using a FileAppender, but it doesn't unlock the actual log4j jar 
file.   The only way it gets unlocked is by performing a *full* shutdown of 
Tomcat.

Shutting down Tomcat is unacceptable because I don't want to affect the 
other apps running on the server.  I have worked around it by not doing a 
full clean build and just doing a normal build which replaces files that 
have changed.  However, this is very inconvenient because if I remove files 
or change the names of files, I need to do a clean build to get rid of the 
old ones.  Plus, I'd like to be able to zip up the build directory 
structure or just remove the entire build from that location without having 
to shut down Tomcat.  In both cases I get errors because the log4j jar file 
is locked.

Now, I would look to Tomcat first and blame it for failing to release 
resources.  However, I don't have this problem with *any* other file, jar 
or otherwise.  So, it seems that Log4j must be doing something 
peculiar.  However, I have yet to figure out what that is.

Can anyone help me figure out what this problem and its solution might 
be?  Do we need to add a new static method called 
LogManager.reallyShutdownNoIReallyMeanItJustShutdownAlready()?

Thanks,

Jake


--
To unsubscribe, e-mail:   
For additional commands, e-mail: