Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can i printStackTrace() to a text file

Status
Not open for further replies.

MartinF

Technical User
Sep 19, 2000
143
FR
Hi,

I am fairly new to Java and i am trying to print the stack trace to a text file because if cannot see all of it in the ms-dos window. The line of code i am trying to use is as follows:

sqle.printStackTrace(new PrintWriter(new FileWriter("SQLException.txt")));


sqle is an SQLException that has been thrown. The code creates the text file, but there is nothing in it.

Thanks in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top