Thursday, October 18, 2007

log4j and j2ee applications

If you use log4j (for that matter java.util.logging package) in J2EE applications?
log4j starts a separate thread for writing log entries (if you use asynchronous Handlers?)
It is important to stop this thread during undeployment of the application. You can stop the thread by calling LogManager.shutdown().
Note: It is not recommended to start thread in J2EE application, then is it recommended to use log4j in j2ee application?
Also it is not recommended to use File IO in J2EE application.
Then how do you do logging for your application? Use logging framework provided by your app server. However logging framework is not yet standard and you will be having vendor specific code. Hope logging framework be part of J2EE specification in near future.

1 comment:

Anonymous said...

So to implement a logging approach in J2EE application what will b eth ebest way to achieve that?
Thanks in advance.

Sani