错误信息

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. java初学者-手动输入一个整数,打印这个数是几位数

    import.java.until.Scanner; //手动输入一个整数,打印这个数是几位数 public static void main(String[]args){ //键盘录入 Scanne ...

  2. MySql 错误:建表时出错1067 - Invalid default value for 'id'

    问题描述: 建表时报错无效的默认值: CREATE TABLE `product`( `id` INT(10) NOT NULL PRIMARY KEY AUTO_INCREMENT COMMENT ...

  3. GIS介绍(详细)一、什么是GIS?

    其他GIS空间分析文章 博主的参考书籍是科学出版社的地理信息系统原理(华一新.赵军喜等) 一.什么是GIS? 要说明什么是GIS,我们就得学习其基本术语,从而引出GIS的定义: 1.信息 狭义的信息论 ...

  4. 纯前端实现后端给数据进行文件导出——angular里面的使用

    interface dataList { cmd_cnt: number; risk_name: string; user_cnt: number; risk_type:string; } listO ...

  5. Javaheima12

    Java 不可变集合 如果某个数据不能修改,把它防御性地拷贝到不可变集合红是个很好的实践 或者当集合对象被不可信的库调用时,不可变形式是安全的 创建 再List,Set,Map接口中,都存在of方法, ...

  6. ansible介绍与简单的使用

    在roles下建立site.yml文件#site.yml - hosts: webservers remote_user: root roles: - websrvs - dbsrvs#将文件拷贝到f ...

  7. git 更改子项目索引

    git update-index --cacheinfo 160000 97ed2f63b07c73bad9a4d55e96e25292 source/lvdao/crf-sdk git reset ...

  8. Windows右键新建菜单中添加md文件

    1.win+r------->regedit 2.找到.md文件夹,双击该文件夹后修改数据的值为".md" 3.在.md文件夹右键新建"项"------& ...

  9. 9. 实现包括前端后台的预约洗狗功能 - 使用Power Automate发送预约邮件 - 使用Power Automate发送带选择按钮(option)的邮件

    ​ 除了发送普通的电子邮件外,我们还可以选择发送带选项的电子邮件来得到客户的反馈,下面我们就一起来创建带有选择功能的电子邮件吧. 1. 打开我们的Power Portal,在左侧导航栏选择流,点击左上 ...

  10. Less-4 报错注入

    补坑:报错注入 当我们 union 无法注入的时候,可以使用报错注入,这里我们有三种报错注入,xpth语法错误和count()+rand()+floor()+group by重复组建错误 extrac ...