hi kim,
am sorry in hurry sent the wrong lines.
 
use this it will work.
 
StringBuffer sb = new StringBuffer();
    StringWriter out=new StringWriter();
    e.printStackTrace(new PrintWriter(out));
    sb.append("\r\n Stack Dump: ");
    sb.append(out.toString());
 

Vikramjit Singh,
Systems Engineer,
GTL Ltd.
Ph. 7612929-3140

-----Original Message-----
From: kim [mailto:[EMAIL PROTECTED]]
Sent: Sunday, January 13, 2002 8:24 PM
To: [EMAIL PROTECTED]
Subject: Re: exception.printStackTrace()

Vikramjit,
"e.printStackTrace()" returns a void.
therefore ,
"strb.append(exception.printStackTrace);"
gives a compile error:
"'void' type not allowed here strb.append(e.printStackTrace());"
any other ways, anybody?
kim.
----- Original Message -----
Sent: Monday, January 14, 2002 12:01 PM
Subject: Re: exception.printStackTrace()

hi kim,
 
what u can do is use StringBuffer to write into the file.
ex : StringBuffer strb  = new StringBuffer();
      strb.append(exception.printStackTrace);
 
and then continue with normal file IO.
 

Vikramjit Singh,
Systems Engineer,
GTL Ltd.
Ph. 7612929-3140

-----Original Message-----
From: kim [mailto:[EMAIL PROTECTED]]
Sent: Sunday, January 13, 2002 7:34 PM
To: [EMAIL PROTECTED]
Subject: exception.printStackTrace()

How can I "exception.printStackTrace()" to a file instead of the tomcat console?
 
 

Reply via email to