Try to redirect the output of System.out to a file using System.setOut
(PrintWriter pw). That's all I can think of for the moment.

Nic

-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Gupta
Amit
Sent: Thursday, March 08, 2001 4:54 AM
To: [EMAIL PROTECTED]
Subject: ServletContext.log().


I have a servlet whose init method calls method from another class.
  public class myservlet{
  public void init(ServletConfig config) throws ServletException{
    myclass mc =3D new myclass();
    mc.printinfo();
  }
  }
  public class myclass{
  public printinfo(){
    System.out.println("This is a print message");
  }
  }
  I want to print all my messages in my servlet container's log file =
instead
  of dumping it on the console. I know there is a way, =
ServletContext.log().
  But how is this applicable in my case? Which command should I use?

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to