今天在学习structs2  2.5.5的版本的时候碰到2个问题。第一个网上下的包里面差log4j-core这个包。

虽然程序可以运行,但控制台会报这个错误。

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

在添加了这个包后在再次运行程序。

控制台提示

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

找不到log4j2的配置文件

网上google之。找到文档。原来只要在classpath下的目录添加一个log4j2.xml。就可以了

<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="warn"><Appenders><Console name="Console" target="SYSTEM_OUT"><PatternLayout pattern="[%-5p] %d %c - %m%n" /></Console><File name="File" fileName="dist/my.log"><PatternLayout pattern="%m%n" /></File></Appenders><Loggers><Logger name="mh.sample2.Log4jTest2" level="INFO"><AppenderRef ref="File" /></Logger><Root level="INFO"><AppenderRef ref="Console" /></Root></Loggers>
</Configuration>

这里为什么这样配置就不说了,可以去查阅log4j2的文档。

在次运行程序,控制台没有错误提示了

我果然还是java菜鸟一个啊,这里只是自己的学习记录,哈哈,大神别喷。

原文:http://xtceetg.blog.51cto.com/5086648/1877001

ERROR StatusLogger Log4j2 could not find a logging implementation.相关推荐

  1. ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the clas

    搭建SSM框架运行,打印输出 ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-c ...

  2. IntelliJ IDEA启动报错:ERROR StatusLogger Log4j2 could not find a logging implementation.

    启动项目时报如下错误: ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core ...

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

    控制台出现 : ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to ...

  4. spring boot 启动报错Log4j2 could not find a logging implementation 解决

    报错日志如下 ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to t ...

  5. Logger Log4j2 could not find a logging implementation.解决方法

    ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the clas ...

  6. Maven : Log4j2 could not find a logging implementation

    1.美图 3.错误信息 Log4j2 could not find a logging implementation. Please add log4j-core to the classpath 解 ...

  7. 关于报错ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging

    在进行单元测试的时候,出现log4j报错ERROR StatusLogger No log4j2 configuration file found. Using default configurati ...

  8. Log4j2报错ERROR StatusLogger Unrecognized format specifier

    目录 问题 解决方法 原因分析 问题 使用maven-shade-plugin或者maven-assembly-plugin插件把项目打成一个可执行JAR包时,如果你引入了log4j2会出现如下问题 ...

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

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

最新文章

  1. centos 7 局域网丢包排查_Nginx搭建局域网yum源问题补充及解决思路与方法转发收藏...
  2. Nutanix CE on Lenovo W520 初探
  3. 总奖金15万,双赛道同名消歧挑战赛报名进行中
  4. (数据库系统概论|王珊)第六章关系数据理论-第一节:为什么要研究关系数据理论
  5. [HTML 5] More about ARIA Relationships
  6. java停止循环label_Java中的break Label 和continue Label 例子(跳出多重循环)(转)...
  7. EditPlus-CN使用总结
  8. 新型消防机器人作文_说一说消防机器人
  9. 这样保养让你皮肤变水嫩 - 生活至上,美容至尚!
  10. sql语句ding_在postgresql中结束掉正在执行的SQL语句操作
  11. 计算机毕业设计django基于python药房药品管理系统(源码+系统+mysql数据库+Lw文档)
  12. 中英文数字混合字符串排序js
  13. 无法同步谷歌日历_这场科技发布会上,谷歌究竟更新了啥?
  14. 张小丫第一次微信支付(讲解)
  15. Docker 安装 It seems there is already a Binary at
  16. DHTMLET-Cascading Style Sheet 2.0
  17. 生产库,查询库和测试库的区别
  18. MAC系统连接Windows共享文件的方法
  19. python怎么做图表好看_如何制作有趣好看的数据可视化图表?
  20. 谷歌程序员年薪高达25万美元以上

热门文章

  1. python怎么加字幕_python3实战之字幕vtt与字母srt的相互转换
  2. Flink+HBase场景化解决方案
  3. GQ1b(NH4+盐)说明书
  4. 织梦wap.php绑定域名,dedecms织梦配置手机wap站点,并绑定二级域名
  5. mysql 视图 事务 存储过程 触发器 __ 邓治安
  6. 互联网废品回收+废品回收小程序开发这些实际功能要有
  7. Chrome小游戏《Boxel Rebound》
  8. 会导致小程序onhide码 手机息屏_小程序onshow事件
  9. golang实现打包dll文件到exe
  10. 微信短信验证码登录教程