How to write Exception output to a file

B

biswa

Hi,
I am trying to write Exception to a file instead of writing to Tomcat
Consol. But i can't find any API that will return me complete Error
Message. Exception.getMessage() returns me only one line description
of error message. I want to write Exception.printStackTrace() output
to file.

May be i am missing something in docs.

Please help.
Thanks.
biswa.
 
B

Bjorn Abelli

biswa said:
Hi,
I am trying to write Exception to a file instead of
writing to Tomcat Consol. But i can't find any API
that will return me complete Error Message.
Exception.getMessage() returns me only one line
description of error message. I want to write
Exception.printStackTrace() output to file.

StackTraceElement[] ste = ex.getStackTrace();

// Bjorn A
 
T

Thomas Kellerer

biswa said:
Hi,
I am trying to write Exception to a file instead of writing to Tomcat
Consol. But i can't find any API that will return me complete Error
Message. Exception.getMessage() returns me only one line description
of error message. I want to write Exception.printStackTrace() output
to file.

May be i am missing something in docs.
What about
<http://java.sun.com/j2se/1.4.2/docs...ble.html#printStackTrace(java.io.PrintStream)>

or

<http://java.sun.com/j2se/1.4.2/docs...ble.html#printStackTrace(java.io.PrintWriter)>

Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top