log4jlog4j2

Difference between slf4j-log4j12 and log4j-slf4j-impl


In some projects which used slf4j and log4j I can see dependencies like

compile('org.apache.logging.log4j:log4j-core:version')
compile('org.apache.logging.log4j:log4j-api:version')
compile('org.apache.logging.log4j:log4j-slf4j-impl:version')

But some projects use slf4j-log4j12 instead of log4j-slf4j-impl. To my understanding they are both works like bridges between slf4j and log4j, but what's their difference?


Solution

  • Those artifacts use different versions of Log4j:

    Since Log4j 1.x reached end-of-life more than 7 years ago, there is no sense in using the first one in new software.