public static String getStackTrace(Throwable t) {
        Writer result = new StringWriter();
        PrintWriter writer = new PrintWriter(result);
        t.printStackTrace(writer);
        try {
            writer.flush();
            result.flush();
            writer.close();
            result.close();
        } catch (IOException e) {
            //swallow
        }
        return result.toString();
    }
Get the full stacktrace as a string

@param t
@return
tika-core/src/main/java/org/apache/tika/utils/ExceptionUtils.java