Java Stacktrace to String getStackTraceAsString(Exception e)

Here you can find the source of getStackTraceAsString(Exception e)

Description

get Stack Trace As String

License

Open Source License

Declaration

private static String getStackTraceAsString(Exception e) 

Method Source Code

//package com.java2s;

import java.io.*;

public class Main {
    private static String getStackTraceAsString(Exception e) {
        ByteArrayOutputStream stackTrace = new ByteArrayOutputStream();
        PrintWriter pw = new PrintWriter(stackTrace);
        e.printStackTrace(pw);//from  w  w w . j  av a 2  s.c o  m
        pw.close();
        return stackTrace.toString();
    }
}

Related

  1. getStackTrace(Exception exception)
  2. getStackTrace(Exception x)
  3. getStacktraceAsString(Exception e)
  4. getStacktraceAsString(Exception e)
  5. getStackTraceAsString(Exception e)
  6. getStackTraceAsString(String pstrMessage, Exception poException)
  7. getStackTraceFromException(Exception _e)
  8. getStackTraceFromException(Exception e)
  9. getStackTraces()