Have you looked at the jakarta taglibs project?  There is one that
preforms logging that uses the log4j package.  You can then enter into
your pages:

<log:debug message="This is a debug message" />
<%
        String message = "something"
%>
<log:info message="<%= message %>" />

You can also use categories like this:

<log:info message="some original output String" category="com.foo.eh" />
<log:error category="com.foo.eh">
        What a crazy error that was!!!
</log:error>

Check out http://jakarta.apache.org/taglibs/doc/log-doc/intro.html
Hope that helps....

-Joe
-----Original Message-----
From: Tom Bednarz [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, October 11, 2001 9:39 AM
To: log4j user list
Subject: Using log4j in JSP's


Hello,

Can log4j be used in JSP's? If so how?

The problem is, that I have to do something like:

class myClass
{
       static Cateory cat = Category.getInstance(myClass.class);
       ........
}

The problem is, that I do not know the name of the class since it is 
generated by the jsp compiler. I currently use jRun. A JSP named myPage 
will become jrun__myClass2ejspb. This is for sure different when I use a

different application server.

Has anybody a suggestion how this problem could be solved?

Thomas


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to