Convert java stack trace to string.

public class StackTraceReader
{
	public static String readStackTrace(Throwable e)
  {
        StringWriter stringWriter = new StringWriter();
        PrintWriter printWriter = new PrintWriter(stringWriter);
        e.printStackTrace(printWriter);
        return stringWriter.toString();
    }
}
BACK TO TOP
Post tagged with: java