• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

where does e.printstacktrace() write to ?

 
ben oliver
Ranch Hand
Posts: 375
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
does it write to windows console only ? can it write to a file ?
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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().
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not an echo. I'm just slow.
 
ben oliver
Ranch Hand
Posts: 375
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by marc weber:
I'm not an echo. I'm just slow.


Good way you have dealt Marc It happens sometimes to many of us!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic