This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I have a program that sends emails automatically. The only that I am missing is to catch error to a file... For example, sometims my server foler will ran out of space and I get this output in my console.
Basically what I want to catch is that when I get that type of error i know is a space issue and I need to empty my folder.
Currently I am loggin to a .txt file that I create using a printStream, do you have any tips...
so my intention is that
If I understand that correctly, you have caught an exception (let's suppose its variable name is "e"). And you have a PrintStream which you use for logging (let's suppose its variable name is "ps"). And you want to write the exception's stack trace to that PrintStream.
If that's all correct, then you just use the printStackTrace method.
Eduardo Ponce de Leon
Joined: May 13, 2009
ok. that makes sense..how do i declare that variable e, what should it be, an exception??
P.S. thanks for the link on my previous post, it was very helpful!!