At 17:30 13.06.2001 +1000, SCOTT FARQUHAR wrote:
>The problem is that Category takes a String, not a class.

Hello Scott,

Categoty.getInstance takes a string or a class. Assuming that the MyFooBar class is in 
the ch.qos package. The following a strictly equivalent:

 Category x = Category.getInstance("ch.qos.MyFooBar");
 Category x = Category.getInstance(MyFooBar.class.getName());
 Category x = Category.getInstance(MyFooBar.class);


>Category cat = Category.getInstance(NameOfTheServlet.class.getName());
>
>If you turn off friendly error messages in IE, you would have been able to see this 
>error.
>
>Scott
>
>
>>>> [EMAIL PROTECTED] 06/13/01 01:15pm >>>
>Hi,
> 
>I'm trying to use log4J with servlets (running on weblogic)
>When I try to create a category instance inside my servlet,
>--------------
>Category cat = Category.getInstance(NameOfTheServlet.class);
>--------------
>This causes internal server error. What exactly could be the problem?
>I've imported the following packages in my servlet:
>--------------
>import org.apache.log4j.xml.DOMConfigurator;
>import org.apache.log4j.Category;
>import org.apache.log4j.Priority;
>--------------
>The java file compiles without any warnings or errors but the servlet 
>during runtime gives 'Internal server error'.
> 
>I would really appreciate a sample code that illustrates the usage of
>log4J with
>servlets. 
> 
>Thanks & regards,
>Amit
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED] 
>For additional commands, e-mail: [EMAIL PROTECTED] 
>
>
>
>-----------------------------------------------------------
>This message has been scanned by MailSweeper.
>-----------------------------------------------------------
>
>
>
>-----------------------------------------------------------
>This e-mail is solely for the use of the intended recepient
>and may contain information which is confidential or
>privileged. Unauthorised use of its contents is prohibited.
>If you have received this e-mail in error, please notify 
>the sender immediately via e-mail and then delete the 
>original e-mail.
>-----------------------------------------------------------
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]

--
Ceki Gülcü


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

Reply via email to