> I don't know where to initialize the static Category so that my servlets,
> actions (MVC using webwork), and ejb's can see it. I'm sure I don't init
> this static category class in each servlet and every other entity that uses
> it, but I'm also now sure how to use this in a j2ee app.
Just put them where you need logging. If UserManagerServlet needs some
logging, then you probably want to give it a category to log to.
If you want to log from an ejb, then put it in the EnterpriseBean subclass.
I have found that it is useful at times to have a logger/category per bean
instance, using a slightly altered category name which appends the hashCode
of the object radix 32.
As a rule of thumb, each class that needs to log has its own
logger/category, some static, some instances depending on how I feel.
Not sure if that helps, perhaps I am missing something.
> Also, I'm using JBoss and JBoss has a log4j.jar in the application classpath
> so I'm thinking that means it uses the app classloader instead of the
> web-app classloader to get at it (or a classloader at a high enough
> hierarchy to access it).
JBoss uses log4j as its core logging system (though there are some parts
which need to be migrated). It is loaded from the JMX MLet. So every
component in JBoss (with a minor exception to the bootstrap code) has
complete access to the log4j api.
--jason
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]