Skip to content

Instantly share code, notes, and snippets.

@okumura
Created July 19, 2013 06:03
Show Gist options
  • Save okumura/6036982 to your computer and use it in GitHub Desktop.
Save okumura/6036982 to your computer and use it in GitHub Desktop.
Get Stack Trace to String by Java.
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
new Throwable().printStackTrace(pw);
String stackTraceString = sw.toString();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment