public static final String stackStraceAsString(final Throwable exception){
  final StringWriter stringWriter=new StringWriter();
  exception.printStackTrace(new PrintWriter(stringWriter));
  return stringWriter.toString();
}

public static final String stackStraceAsString ( final Throwable exception ) { final StringWriter stringWriter = new StringWriter ( ) ; exception . printStackTrace ( new PrintWriter ( stringWriter ) ) ; return stringWriter . toString ( ) ; }
converts exception stack trace as string
