public static String getStackTrace(Throwable throwable) {
    StringWriter sw = new StringWriter();
    throwable.printStackTrace(new PrintWriter(sw, true));
    return sw.toString();
  }
Utility to get a stack trace as a string from a Throwable
geode-core/src/main/java/org/apache/geode/internal/logging/LogWriterImpl.java