通过字符串对象接收异常的堆栈信息


PrintWriter pw = null;
ByteArrayOutputStream byteOutputStream = new ByteArrayOutputStream();
pw = new PrintWriter(byteOutputStream, true);
e.printStackTrace(pw);
String exMessage = byteOutputStream.toString();

你可能感兴趣的:(java)