It writes only to System.err, which is the console (unless you've redefined it, which you probably don't want to do). But if you look in the API, there's an overloaded version of this method which is probably what you want. There's also a method getStackTrace() which gives you even more flexibility in what to do with the info. [ January 30, 2008: Message edited by: Jim Yingst ]
With no arguments, printStackTrace() "prints this throwable and its backtrace to the standard error stream." (See java.lang.Throwable.) But the method is overloaded to also take a PrintStream or a PrintWriter.
Also note the method getStackTrace().
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer sscce.org