Here you can find the source of stackTraceToString(Throwable e)
public static final String stackTraceToString(Throwable e)
//package com.java2s; //License from project: LGPL public class Main { public static final String stackTraceToString(Throwable e) { StringBuilder sb = new StringBuilder(); for (StackTraceElement element : e.getStackTrace()) { sb.append(element.toString()); sb.append("\n"); }/* ww w. j a va2s. co m*/ return sb.toString(); } }