今天在修改项目是修改了pom中的配置启动后提示下面的错误,

 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.

而且日志内容也不再显示。

查看网址的内容解决方法

Failed to load class org.slf4j.impl.StaticLoggerBinder

This warning message is reported when the org.slf4j.impl.StaticLoggerBinder class could not be loaded into memory. This happens when no appropriate SLF4J binding could be found on the class path. Placing one (and only one) of slf4j-nop.jar slf4j-simple.jarslf4j-log4j12.jarslf4j-jdk14.jar or logback-classic.jar on the class path should solve the problem.

SINCE 1.6.0 As of SLF4J version 1.6, in the absence of a binding, SLF4J will default to a no-operation (NOP) logger implementation.

If you are responsible for packaging an application and do not care about logging, then placing slf4j-nop.jar on the class path of your application will get rid of this warning message. Note that embedded components such as libraries or frameworks should not declare a dependency on any SLF4J binding but only depend on slf4j-api. When a library declares a compile-time dependency on a SLF4J binding, it imposes that binding on the end-user, thus negating SLF4J's purpose.

翻译过来就是:

这个错误是当org.slf4j.impl报道。StaticLoggerBinder类不能被加载到内存中。发生这种情况时,无法找到合适的SLF4J绑定类路径。slf4j-nop放置一个(且只有一个)。slf4j-simple jar。slf4j-log4j12 jar。slf4j-jdk14 jar。jar或logback-classic。jar的类路径应该解决这个问题。

解决方法就是添加下面的依赖:

<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-access</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
</dependency>

也测试了加入

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

但是日志的显示效果不是自己想要的,springboot推荐的是logback.xml来管理日志,而且我在项目中添加了对应的logback_spring.xml文件

SLF4J: Failed to load class "org.slf4j.impl.StaticLo的更多相关文章

  1. Mina 中遇到SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder"

    SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".SLF4J: Defaulting to no-op ...

  2. eclipse maven SLF4J: Failed to load class org.slf4j.impl.StaticLoggerBinder

    现象:运行eclipse maven build,console 有红色日志如下: SLF4J: Failed to load class "org.slf4j.impl.StaticLog ...

  3. Kafka生产者案例报警告SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".

    一.SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". 这个报警告的原因简单来说时因为slf4j的版本 ...

  4. java项目跑起来报错: 程序报 SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". 错误

    问题: 我用的是ssm框架结合, 利用junit测试的时候抛出 SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder& ...

  5. 解决 程序报 SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". 错误

    调试程序出现如下错误: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".SLF4J: Default ...

  6. SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".错误的解决方法

    1.今天新git下来的项目报错如下: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".SLF4J: ...

  7. SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”

    1.问题描述: 我的项目是tcServer,在运行的之后出现如下错误: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBin ...

  8. 解执行maven项目出现 SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”. error

    最近再弄maven项目,运行起来没有问题,但是Console控制台会报错,比如说如下的问题异常提示: 由此我们可以看出,报出错误的地方主要是slf4j的jar包,而故障码中“Failed to loa ...

  9. 解决执行maven项目出现 SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”. error

    最近再弄maven项目,运行起来没有问题,但是Console控制台会报错,比如说如下的问题异常提示: 由此我们可以看出,报出错误的地方主要是slf4j的jar包,而故障码中“Failed to loa ...

随机推荐

  1. docker 国内镜像加速

    CentOS7 对于使用 systemd 的系统,请在 /etc/docker/daemon.json 中写入如下内容(如果文件不存在请新建该文件): {"registry-mirrors& ...

  2. elastalert 用import属性来组织,引入配置

    对应rule的一些公用规则,可以放到一个或者多个头文件中.主的rule yaml文件引入即可.文件名随意,最好别用yaml后缀,要不会被当做一个rule.另外import在rule文件中只能出现一次. ...

  3. 【Spring Boot学习之九】缓存支持

    环境 eclipse 4.7 jdk 1.8 Spring Boot 1.5.2 一.Spring Boot Cache以及整合EhCacheSpring从3.1开始定义了org.springfram ...

  4. es内存不够

    8核32G 3台 ELS机器,当时只给es配置了8G内存,es的总体数据量大小将近30G(查看GET /_cat/shards?v)

  5. Dubbo2.7.3入门

    2.7.X的Dubbo,包名不再是com.alibaba,而是org.apache 先看工程目录结构 一个公共api模块,一个SpringBoot项目充当Dubbo服务,一个SpringBoot项目充 ...

  6. C# int uint long ulong byte sbyte float double decimal 范围,及类型!

    static void Main(string[] args) { Console.WriteLine(" byte {0,7:g}{1,32:g}{2,32:g}",typeof ...

  7. 【数据结构】12.java源码关于ConcurrentHashMap

    目录 1.ConcurrentMap的内部结构 2.ConcurrentMap构造函数 3.元素新增策略4.元素删除5.元素修改和查找6.特殊操作7.扩容8.总结 1.ConcurrentMap内部结 ...

  8. Codeforces Round #581 (Div. 2)

    A:暴力. #include<cstdio> #include<cstring> #include<iostream> #include<algorithm& ...

  9. C#Dictionary不能添加重复键的解决方法

    重载了一个方法: public class RepeatDictionaryComparer : IEqualityComparer<string> { public bool Equal ...

  10. ELK学习笔记之Logstash不停机自动重载配置文件

    0x00 自动重新加载配置 为了可以自动检测配置文件的变动和自动重新加载配置文件,需要在启动的时候使用以下命令: ./bin/lagstash -f configfile.conf --config. ...