简体   繁体   English

log4j-slf4j2-impl 不包含 log4j-core,这是故意的吗?

[英]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.我注意到log4j-core在两个slf4j-impl库中有不同的依赖范围。

Is this by design?这是设计使然吗?

log4j-core scope log4j-core scope
log4j-slf4j-impl runtime 运行
log4j-slf4j2-impl test 测试

Looks like it was changed with this commit , which references LOG4J2-2975 .看起来它已随此提交更改,它引用了 LOG4J2-2975 I don't see anything that mentions why the scope was changed from runtime to test .我没有看到任何提及scoperuntime更改为test的内容。

Yes, removing the runtime dependency on log4j-core was intentional, since the log4j-slf4j2-impl module works with any implementation of the Log4j2 API.是的,删除对log4j-core的运行时依赖是有意的,因为log4j-slf4j2-impl模块适用于 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).自版本 2.17.2 起,至少有两个实现可以与 SLF4J-to-LOG4J2 桥接一起使用: log4j-corelog4j-to-jul (Log4j2 项目维护的第三个实现log4j-to-slf4j不能使用出于显而易见的原因)。

This choice was not undisputed: cf.这个选择不是没有争议的:cf。 LOG4J2 3601 for a discussion. LOG4J2 3601进行讨论。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Log4j2上使用Slf4j时为什么log4j-slf4j-impl不依赖于log4j-core - Why has log4j-slf4j-impl no dependency on log4j-core when using Slf4j over Log4j2 slf4j-log4j12 和 log4j-slf4j-impl 的区别 - Difference between slf4j-log4j12 and log4j-slf4j-impl 无法解析 Log4j-core 2.3 上的 BasicConfigurator 类 - Cannot resolve BasicConfigurator class on Log4j-core 2.3 log4j-slf4j-impl 不能与 log4j-to-slf4j 一起出现——在向 pom 添加 graphql 依赖之后 - log4j-slf4j-impl cannot be present with log4j-to-slf4j — after adding graphql dependency to pom log4j-slf4j-impl / log4j v2 - 设置自定义 log4j.xml 目标 - log4j-slf4j-impl / log4j v2 - setting custom log4j.xml destination 引起:org.apache.logging.log4j.LoggingException: log4j-slf4j-impl cannot be present with log4j-to-slf4j Issue - Caused by: org.apache.logging.log4j.LoggingException: log4j-slf4j-impl cannot be present with log4j-to-slf4j Issue Class 路径包含多个 SLF4J 绑定,log4j-slf4j-impl-2.7.jar,slf4j-log4j12-1.7.21.Z68995FCBF432492D40484DAC04A9 - Class path contains multiple SLF4J bindings,log4j-slf4j-impl-2.7.jar,slf4j-log4j12-1.7.21.jar SLF4J:使用 log4j 时无法加载类“org.slf4j.impl.StaticLoggerBinder”错误 - SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder" error when using log4j 使用slf4j和log4j - using slf4j with log4j Log4j slf4j无法正常工作 - Log4j slf4j not working
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM