Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

log4j-slf4j2-impl does not include log4j-core, is this intentional?

I noticed that log4j-core has different dependency scope in the two slf4j-impl libraries.

Is this by design?

log4j-core scope
log4j-slf4j-impl runtime
log4j-slf4j2-impl test

Looks like it was changed with this commit, which references LOG4J2-2975. I don’t see anything that mentions why the scope was changed from runtime to test.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Yes, removing the runtime dependency on log4j-core was intentional, since the log4j-slf4j2-impl module works with any implementation of the Log4j2 API.

Since version 2.17.2 at least two implementations can be used with the SLF4J-to-LOG4J2 bridge: log4j-core and log4j-to-jul (the third implementation maintained by the Log4j2 project, log4j-to-slf4j, can not be used for obvious reasons).

This choice was not undisputed: cf. LOG4J2 3601 for a discussion.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading