close
方法1:
String excepStr = org.apache.commons.lang.exception.ExceptionUtils.getStackTrace( throwable ) ;
方法2:
StringWriter errors = new StringWriter(); ex.printStackTrace(new PrintWriter(errors)); return errors.toString();
StringWriter PrintWriter Throwable
參考:
● java - How can I convert a stack trace to a string? - Stack Overflow
● java - How to store printStackTrace into a string - Stack Overflow
文章標籤
全站熱搜
留言列表