Slf4j is really just a logging facade. However, Log4j should be replaced by Logback from the same authors.
Update : if you want to learn about another advantage of Slf4j, then the fact that the following (ugly) constructs are no longer needed to avoid an unnecessary call toString() :
if (logger.isDebugEnabled()) { logger.debug("Message: " + bigObject + ", " + anotherBigObject); }
Instead, you can use parameterized messages:
logger.debug("Message: {}, {}", bigObject, anotherBigObject);
Also see What is the fastest (non) logging method?
BalusC Jan 14 '10 at 12:16 2010-01-14 12:16
source share