如何将日志的错误信息打印出来
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)
