Here you can find the source of exceptionStackTrace(Exception ex)
public static String exceptionStackTrace(Exception ex)
//package com.java2s; //License from project: Open Source License public class Main { public static String exceptionStackTrace(Exception ex) { StringBuffer buffer = new StringBuffer(); for (StackTraceElement element : ex.getStackTrace()) { buffer.append(element.toString()); buffer.append("\n"); }//from w w w . java2 s. com return buffer.toString(); } }