Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > How to write Exception output to a file

Reply
Thread Tools

How to write Exception output to a file

 
 
biswa
Guest
Posts: n/a
 
      10-27-2003
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.
 
Reply With Quote
 
 
 
 
Bjorn Abelli
Guest
Posts: n/a
 
      10-27-2003

"biswa" <> skrev i meddelandet
news: ...
> 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



 
Reply With Quote
 
 
 
 
Thomas Kellerer
Guest
Posts: n/a
 
      10-27-2003
biswa schrieb:

> 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/api/java/lang/Throwable.html#printStackTrace(java.io.PrintStream )>

or

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

Thomas


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exception of type 'System.Web.HttpUnhandledException' wasthrown.Exception has been thrown by the target of an invocation.System.WebSystem.Exception jobs ASP .Net 1 11-16-2007 05:57 PM
while executing my client program i get the exception javax.naming.LinkException: [Root exception is javax.naming.LinkException: [Root exception is javax.naming.NameNotFoundException: remaining if plz anybody know how to solve this problem then mahesh Java 0 03-08-2007 12:26 PM
Newbie: How do I filter output to the screen and writing the orginal output to a file? Mav Perl Misc 22 07-09-2004 09:56 PM
parse output screen ok but cant get desired output new file! chuck amadi Python 1 06-23-2004 02:16 PM
Error BC31019: Unable to write to output file '<filename>' Joel Finkel ASP .Net 1 08-15-2003 03:48 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57