错误信息

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

错误分析

1)状态记录器没有找到log4j2配置文件,将使用默认配置:只将错误记录到控制台。

2)log4j2的jar包是hibernate5、MyBatis框架自带的log4j2,在SSH、SSM中即使自己导入了第三方日志包,系统依然会调用log4j2,缺省默认配置文件 log4j2.xml

解决方案

  • 增加配置文件 log4j2.xml

    + log4j版本:2.9.1

    + 配置文件位置: src/main/resources/log4j2.xml (最终编译后,应放置的位置:/classpath)
<?xml version="1.0" encoding="UTF-8"?>

<Configuration status="warn">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%m%n" />
</Console>
</Appenders>
<Loggers>
<Root level="INFO">
<AppenderRef ref="Console" />
</Root>
</Loggers>
</Configuration>

参考文献

[MyBatis]问题:ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.的更多相关文章

  1. 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 ...

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

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

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

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

  4. Log4j2报错ERROR StatusLogger Unrecognized format specifier

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

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

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

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

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

  7. Error: Cannot open main configuration file '//start' for reading! 解决办法

    当执行service nagios start启动nagios时,报错:Error: Cannot open main configuration file '//start' for reading ...

  8. springMVC+mybatis 进行单元测试时 main SqlSessionFactoryBean - Parsed configuration file: 'class path resource' 无限的读取xml文件

    今天终于写完的Dao层的操作,怀着无比激动的心情,进行单元测试,就在最后一个方法,对的就是最后一个方法,启动单元测试就会报以下错误: [2016-05-11 18:25:01,691] [WARN ] ...

  9. [ERROR] Can't find error-message file '/data/mysql/share/errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.

    1. MySQL5.7.21启动时报错: [ERROR] Can't find error-message file '/data/mysql/3307/share/errmsg.sys'. Chec ...

  10. [ERROR ] Error parsing configuration file: /etc/salt/minion - conf should be a document, not <type 'str'>.

    错误信息 [ERROR ] Error parsing configuration file: /etc/salt/minion - conf should be a document, not &l ...

随机推荐

  1. Android studio应用

    菜单的使用 public class FirstActivity extends AppCompatActivity { @Override protected void onCreate(Bundl ...

  2. 一,创建一个electron应用程序

    之前我们已经用html+css+js创建了一个项目,现在将这个项目用electron以应用程序呈现. 1,首先新建一个文件夹,从终端进入该文件夹: 2,在该文件夹下执行npm init,初始化该项目. ...

  3. ajax高级(请求服务器脚本,数据库, ajxa xml文件)

    请求jsp与请求普通文件不通过的地方,请求jsp可能会传参,比如搜索,用户名,页码这些 html部分:<input type="text" id="txt1&quo ...

  4. ReSharp的安装和使用教程

    1.ReSharp的安装及破解: (1)不多说,直接上下载链接: 链接:https://pan.baidu.com/s/1cJmTQxDS-OHmHs46Q_hbMg 提取码:shiz (2)下载好解 ...

  5. linux 文件系统和包管理工具rpm,yum

    文件系统 1.什么是文件系统? 文件系统是一种存储和组织计算机中数据文件的机制或方法,他使得对计算机内的数据的存储.访问和查找变得更容易,简单. 文件系统落到计算机里其实就是一个应用软件 ext2 e ...

  6. EF调用sql语句

    1.连接数据库 2.在Dal进行调用sql语句 public List<UserInfo> PageShow(out int totalcount,out int totalpage, s ...

  7. ddddd

    项目二阶段总结 账户微服务 短信发送 1.压测发现问题 首先对短信smscomponent的send方法在test单元测试类中测试,不是真的发短信测试,可以建立请求开始和结束的时间戳来确定请求的耗时. ...

  8. Sentinel介绍与使用

    https://blog.csdn.net/noaman_wgs/article/details/103328793

  9. 【Unity】使用dmp文件定位Player崩溃原因

    写在前面 如果在Player运行时突然崩溃,仅靠Player.log日志文件不能定位引起崩溃的代码,那么可以尝试利用dmp(仅限Windows平台)文件定位崩溃原因. 正文 环境 Unity 2020 ...

  10. 转载·Pycharm Pro“This license 56ZS5PQ1RF has been cancelled” 激活码失效处理记录

    今天打开许久没用的Pycharm提示激活码过期,激活提示:"This license 56ZS5PQ1RF has been cancelled" 解决方法如下 首先修改hosts ...