网站首页 美食营养 游戏数码 手工爱好 生活家居 健康养生 运动户外 职场理财 情感交际 母婴教育 时尚美容 知识问答

如何将日志的错误信息打印出来

时间:2024-10-14 07:08:48

1、这里的话我直接给大家代码吧!StringWriter sw = null; PrintWriter pw = null; try { sw = new StringWriter(); pw = new PrintWriter(sw);

如何将日志的错误信息打印出来

3、if (sw != null) { try { sw.close(); } catch (IOException e1) { e1.printStackTrace(); } } if (pw != null) { pw.close(); } }     log.err(sw.toString());

如何将日志的错误信息打印出来

5、final String duration = DurationFormatUtils.formatDurationWords(durat足毂忍珩ionMillis, true, true); log.info("Importing took: {}ms ({})", durationMillis, duration); //Importing took: 123456789ms (1 day 10 hours 17 minutes 36 seconds)

如何将日志的错误信息打印出来
© 2025 小知经验
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com