如何仅在调试中获取完整的堆栈跟踪。 现在我有了这个,但我希望应该有一些更优雅的东西:
} catch (Exception e) {
if (log.isDebugEnabled()) {
log.debug("Something went wrong", e);
} else {
log.info("Something went wrong: {}", e.toString());
}
}