0
出于好奇,有什么好处登陆(使用log4j的),使用上述方法时:调试消息记录
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("New Session Created");
}
,而不仅仅是:
LOGGER.debug("New Session Created");
是它只是一个(潜在)性能增强,它仍然是相关的?这应该用于包装所有的调试输出?
感谢您的想法!
在使用logger.debug()之前必要的[Log4j isDebugEnabled()是否可能重复?](http://stackoverflow.com/questions/17850614/is-log4j-isdebugenabled-necessary-before-using-logger-debug ) – devnull
另请参阅http://stackoverflow.com/questions/963492/in-log4j-does-checking-isdebugenabled-before-logging-improve-performance – devnull