java代码将e.printStackTrace()写入log4j文件异常信息
try { ... } catch (Exception e) { log.error( "failed!", e ); }
或者
try { ... } catch (Exception e) { log.error( "failed!", e.fillInStackTrace() ); }
try { ... } catch (Exception e) { log.error( "failed!", e ); }
或者
try { ... } catch (Exception e) { log.error( "failed!", e.fillInStackTrace() ); }