问题: ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console..

场景: 在配置SSH的时候遇到了这个错误, 然后就需要找一下问题

分析: 按照英文提示, 是说缺少了一个log4j-core.jar的日志核心包

解决方法: 下载log4j-core.jar包

下载地址:

http://central.maven.org/maven2/org/apache/logging/log4j/log4j-core/2.11.2/log4j-core-2.11.2.jar

然后在 src 目录下新建 log4j2.xml

<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
</Console>
</Appenders>
<Loggers>
<Root level="info">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>

重启tomcat,ok!

注意! 必须要重启tomcat! 而且要把out目录下的web.xml文件删除掉

因为Tomcat执行的时候, 是按照out目录下面的web.xml去执行的.

如果没有重启tomcat, 这个错误会一直都在, 重启了之后就没有了!

参考资料: https://ask.csdn.net/questions/663142

ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath的更多相关文章

  1. ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...

    Struts2未配置Log4j2.xml报错 Log4j2.xml中的配置 log4j的jar包:log4j-core-2.7.jar log4j2只支持xml和json两种格式的配置,所以配置log ...

  2. 使用Log4j2,打包后提示ERROR StatusLogger Log4j2 could not find a logging implementation.

    从Log4j切换到Log4j2,没有打包之前日志输出正常,但是打包后总是提示下面内容: 错误一: ERROR StatusLogger Log4j2 could not find a logging ...

  3. ERROR StatusLogger Log4j2 could not find a logging implementation.

    今天在学习structs2  2.5.5的版本的时候碰到2个问题.第一个网上下的包里面差log4j-core这个包. 虽然程序可以运行,但控制台会报这个错误. ERROR StatusLogger L ...

  4. log4j报错ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.

    ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only err ...

  5. 测试中出现ERROR StatusLogger No log4j2 configuration file

    概述 在hibernate框架搭建完成用log4j2进行测试时,总是出现ERROR StatusLogger No log4j2 configuration file found. Using def ...

  6. Log4j2报错ERROR StatusLogger Unrecognized format specifier

    问题 使用maven-shade-plugin或者maven-assembly-plugin插件把项目打成一个可执行JAR包时,如果你引入了log4j2会出现如下问题: ERROR StatusLog ...

  7. Log4j2 - Unable to invoke factory method in class org.apache.logging.log4j.core.appender.RollingFileAppender for element RollingFileAppender for element RollingFile

    问题与分析 在使用Log4j2时,虽然可以正确读取配置文件并生成log文件,但偶然发现控制台打印了异常信息如下: 2018-12-31 17:28:14,282 Log4j2-TF-19-Config ...

  8. 巨坑npm run dev 报错 终于找到正确答案 Error: EPERM: operation not permitted, open '/data/public/build/css/add.p

    Windows10环境 npm run dev 报错  终于找到正确答案 Error: EPERM: operation not permitted, open '/data/public/build ...

  9. Spring Boot ERROR StatusLogger No Log4j 2 configuration file found

    1. 问题描述 项目之前的 log4j2 配置没问题,把 pom 文件中的 spring-boot-starter-web 依赖删除后,然后启动项目就报错找不到 log4j2.yml 文件. 之前引用 ...

随机推荐

  1. cclfow_小流程设计

    官网演示地址:http://demo.ccflow.org/ 流程的主要需求: 新建流程 登陆系统后台进行设置流程:鼠标右键流程树 选择新建子级类别 输入子级类别名称:流程演示,点击确定即可 点击流程 ...

  2. 设置socket IP_TOS选项 (转载)

    转自:http://zhangjunxin520.blog.163.com/blog/static/305037032011721102857609/ 在IP头中,有一Type-of-Service字 ...

  3. Codeforces - 474D - Flowers - 构造 - 简单dp

    https://codeforces.com/problemset/problem/474/D 这道题挺好的,思路是这样. 我们要找一个01串,其中0的段要被划分为若干个连续k的0. 我们设想一个长度 ...

  4. c# 异常找不到源代码的情况

    简单说下原因,调用的是dynamic参与的函数 dynamic dataqueue = pi.GetValue(this,null); var eo = ErrorObject.True; var v ...

  5. MySQL `explicit_defaults_for_timestamp` 与 TIMESTAMP

    考察下面的 SQL 脚本: CREATE TABLE test1( id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, data VARCHAR(20), ts1 ...

  6. 第三篇 .NET高级技术之深拷贝和浅拷贝

    深拷贝.浅拷贝 如果拷贝的时候共享被引用的对象就是浅拷贝,如果被引用的对象也拷贝一份出来就是深拷贝.(深拷贝就是说重新new一个对象,然后把之前的那个对象的属性值在重新赋值给这个用户) using S ...

  7. sql mysql和sqlserver存在就更新,不存在就插入的写法(转)

    转自:http://hi.baidu.com/tidy0608/item/ff930fe2436f2601560f1dd9 sqlsever数据存在就更新,不存在就插入的两种方法 两种经常使用的方法: ...

  8. 题解报告:hdu 3549 Flow Problem(最大流入门)

    Problem Description Network flow is a well-known difficult problem for ACMers. Given a graph, your t ...

  9. Linux 导出Okular 编辑的pdf批注

    1.环境 ubuntu 14.04 LTS Okular Version 0.19.3 Using KDE Development Platform 4.13.3 2.方法 2.1只导出批注,不改变p ...

  10. org.codehaus.jettison.json.JSONObject使用方法

    public static void main(String[] args) { System.out.println("测试开始"); File file = new File( ...