tag:blogger.com,1999:blog-8712770457197348465.post1593925206886413988..comments2024-03-28T02:47:19.159-07:00Comments on Javarevisited: How to Get & Print current Thread stack trace in Java - Debugging Tutorial Examplejavin paulhttp://www.blogger.com/profile/15028902221295732276noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-8712770457197348465.post-43041701440142773292018-12-16T11:19:33.416-08:002018-12-16T11:19:33.416-08:00Pls solved error applicationPls solved error applicationAnonymoushttps://www.blogger.com/profile/11044489871308081105noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-26235096219944069492014-03-29T09:10:34.255-07:002014-03-29T09:10:34.255-07:00@Javin perfect article ..just want to add what I h...@Javin perfect article ..just want to add what I have added ..<br /><br />I have a utility method that returns a string with the stacktrace:<br /><br />static String getStackTrace(Throwable t) {<br /> StringWriter sw = new StringWriter();<br /> PrintWriter pw = new PrintWriter(sw, true);<br /> t.printStackTrace(pw);<br /> pw.flush();<br /> sw.flush();<br /> return sw.toString();SARAL SAXENAhttps://www.blogger.com/profile/01084233786047386880noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-16760482683134951522013-04-22T07:05:52.236-07:002013-04-22T07:05:52.236-07:00The RoboGuice framework includes a logger class th...The RoboGuice framework includes a logger class that uses this technique to find the class that is making the logging call. It is a logger that requires no configuration (i.e. you don't have to pass a class or string tag to it to tell it which logger it is). All you do is make static method calls.<br /><br />See the source here: https://github.com/roboguice/roboguice/blob/master/roboguice/srcdalewkinghttps://www.blogger.com/profile/08300031429025278242noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-74764776031435330042013-04-08T07:03:47.689-07:002013-04-08T07:03:47.689-07:00I see you are declaring logger, but not using it i...I see you are declaring logger, but not using it in the example. I say that, because I'm trying to solve the same problem - to print the stack trace - but want to print it in the logger ... The thing is that the method Thread.currentThread().getStackTrace() is available since Java 1.5, but I'm using Java 1.4. Any idea how to print the stack trace in the logger with Java 1.4?Borislav Kirilovhttps://www.blogger.com/profile/15887240375777778292noreply@blogger.com