问题: 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. Java调用外部类定义的方法(Static与无Static两种)

    首先定义方法 public class Dy { public int Add(int x,int y){ //定义Add(),该方法没有被static修饰 return x+y; } public ...

  2. oracle 查看表是否存在、包含某字段的表、表是否包含字段

    表是否存在: select count(*) from user_tables where table_name = #{tablename} 包含某个字段的表 select * from user_ ...

  3. grep在指定类型的文件中查找字符 (转载)

    转自:http://blog.csdn.net/qvbfndcwy/article/details/8127329 find -name '*.php'|xargs grep 'include'//在 ...

  4. lightoj 1031【区间DP,未完待续】

    题意: 给你一个n,再给你n个数,每个数<1e4; 有两个player交替取数字,每个人每一次能拿一个或多个,交替在两边拿. 游戏终止在所有的数字被取完. 两个人的分数就是所取得的数字大小总和. ...

  5. lightoj1079【背包】

    题意: 哈利波特抢银行... 给出n个银行,每个银行有a[i]百万和b[i]的风险.然后再给一个风险值P,不能超过P. 思路: 如果告诉你概率的小数的位数,可能这个就会不一样了... 慨率的计算,风险 ...

  6. 洛谷P3577 [POI2014]TUR-Tourism

    给定一个n个点,m条边的无向图,其中你在第i个点建立旅游站点的费用为Ci.在这张图中,任意两点间不存在节点数超过10的简单路径.请找到一种费用最小的建立旅游站点的方案,使得每个点要么建立了旅游站点,要 ...

  7. Hibernate中表与表之间的关联一对多,级联保存和级联删除

    1:Hibernate的一对多操作(重点) 一对多映射配置 第一步:创建两个实体类:客户和联系人(例)以客户为一,联系人为多: package com.yinfu.entity; public cla ...

  8. bzoj 5018 [Snoi2017]英雄联盟

    题面 https://www.lydsy.com/JudgeOnline/problem.php?id=5018 题解 简单的dp 令dp[i][j]表示前i个英雄 总花费为j 最大能够得到的展示种数 ...

  9. python对ini配置文件处理

    实例文件: [root@docker2 ~]# cat test.ini [base] host = 192.168.88.121 port = 3306 user = root path = /ho ...

  10. Keepalived+Nginx实现Nginx的高可用

    集群规划 主机名 IP VIP Nginx:port KeepAlived主备 KA_NG_01 192.168.30.130 192.168.30.120 8088 MASTER KA_NG_02 ...