使用 Jedis 操作 Redis 时 SLF4J 报错

报错信息:

使用 jedis 4.x.x 时报以下错误:

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.

解决方法:

加入以下依赖:

<-- 解决类加载问题 -->
<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-api</artifactId>
    <version>2.0.2</version>
</dependency>

<-- 解决程序未找到问题 -->
<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-api</artifactId>
    <version>2.0.2</version>
</dependency>

猜你喜欢

转载自blog.csdn.net/weixin_57542177/article/details/127075279