为什么给slf4j-log4j12添加依赖不能使slf4j正常工作?

Why adding a dependency to slf4j-log4j12 does not make slf4j work properly?

我有一个使用 slf4j 的项目。所以我需要提供一个底层框架。 我想使用 log4j,所以我在我的 pom.xml 中指定了以下依赖项,如指定的 here :

<dependency> 
  <groupId>org.slf4j</groupId>
  <artifactId>slf4j-log4j12</artifactId>
  <version>1.8.0-beta2</version>
</dependency>

但我仍然有以下错误信息:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

根据 this,不应再出现。

如果我将依赖项更改为这个在网上找到的依赖项,它会起作用:

<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-simple</artifactId>
    <version>1.7.21</version>
</dependency>

有人解释一下吗?

问题仅仅是因为使用了 slf4j 的测试版。指定对稳定版本的依赖使其正常工作:

<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-simple</artifactId>
    <version>1.7.25</version>
</dependency>