Hmm. I try to avoid 'method repositories' where possible. I also try to put as little Java code in a JSP as possible. That way, I find that I don't often have much of interest to log from a JSP. Anyway, here are a couple suggestions.
 
First, why not have a look at the Jakarta Log Tag Library. It may be just what you need.
 
If you want to develop your own class, you might consider designing a JavaBean that you could instantiate with page scope using the JSP useBean tag and use bean set tags to set its properties -- like the name for the Category. Your bean would have logging methods that duplicate those of Category. It could retrieve the Category instance based on its name property and delegate calls to the Category object.
 
Best regards,
Jim Cakalic
-----Original Message-----
From: Seemantini Godbole [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 23, 2001 10:27 AM
To: 'LOG4J Users Mailing List'
Subject: RE: Log4J in JSP??

Sumit,
 
You may want to design a class with all static methods which will do logging to log4j. It could have a method such as....
 
public static void doInfoLog(String catName, String message)
{
    Category cat = Category.getInstance(catName);
 
    //log the message to this category
}
 
You could use this class and method in your JSP.
 
 
Thanks,
seemantini
 
-----Original Message-----
From: Sumit Mishra [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 23, 2001 10:09 AM
To: '[EMAIL PROTECTED]'
Subject: Log4J in JSP??

Hi guys,

 

This is my first message to this list..

I just wanted to figure out whether I could use log4j in JSPs for logging purpose?

I have already used log4j in Java class and EJBs.

Thanx in anticipation

 

Sumit Mishra

Everyone makes mistakes. The trick is to make them when nobody  is looking.

 



DISCLAIMER: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer.

Thank you.

CashTech Solutions.



Reply via email to