EJB design: How to log the events in EJB?
- Posted by: Shriram Mogallapalli
- Posted on: September 07 2000 14:16 EDT
I would like to log some of the events while executing my ben to a log file. How is this possible? I have gone through the ejb1.1 spec i couldn't find anything about logging feature.
I'm using weblogic5.1 and i noticed that some of the events are logged by the container. Is it possible to get the handle to this?
is it possible to use the servelt log? if so is this is the common practise?
I'm sure most of you who have implemented EJB solutions would have taken some approach on this? can anyone throw some light on this aspect.
In Weblogic just use System.out - it will go to weblogic.log
Sun Log API is under development now, it should be included in J2EE v 2.0. For now you can use System.out for logging (works in Weblogic). BUT this is the bad way to handle logging because you can not filter messages, you can not redirect messages to the different output (say, log file).
I think it's better to use special logging libraries. For example, you can use JTrack or GraceLog API (which is opensource).
By the way, Weblogic also has special logging feature, see Weblogic Events section of Weblogic documentation.
Thanx for your inputs guys. I'll look in to the documentation of weblogic.