org.linkedin.util-core/src/main/java/org/linkedin/util/lang/LangUtils.java
public static String getStackTrace(Throwable th)
  {
    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    th.printStackTrace(pw);
    return sw.toString();
  }
public static String getStackTrace(Throwable th)
  {
    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    th.printStackTrace(pw);
    return sw.toString();
  }
Returns the stack trace of the throwable as a string

@param th the throwable
@return the stack trace as a string