for a simple example try this:
* include log4j.jar with your app
* For each class you want to log add a category. ie:
Class Foo, add:
static Category logCat =
Then when you want to go
Not sure how this will go for jsp though. Should still go.
Has anyone actually got this to work for JSPs?
I'm using JBoss-2.4.4/Tomcat-3.2.3.
As usual it's the deployment side where information seems
to be lacking rather than the coding.
I have also seen contradictory information on whether
log4j.jar should be WEB-INF/lib and where to put the
Well, i think that log4j is already on the jboss classpath, as it is heavily used by jboss itself, so you shouldn't have to worry about that.
Within JBoss, the log4j.properties file is only used in the first phase of the startup: as soon as the JBoss log4j service is started, everything from this file is ignored. So you'd probably want to put your logj config stuff in the log4j.xml in the conf directory.
Btw, if it doesn't work, tell us what is actually going wrong...