Here you can find the source of stackTraceGenerate()
public static String stackTraceGenerate()
//package com.java2s; //License from project: Open Source License public class Main { public static String stackTraceGenerate() { StackTraceElement[] steArr = Thread.currentThread().getStackTrace(); String ret = ""; for (StackTraceElement ste : steArr) { ret += ste.toString() + "\n"; }//w ww. j av a2 s.c o m return ret; } }