错误信息

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. 基于redis设计的秒杀活动

    FlashSale 意为 秒杀,是电子网上商城促销活动的一种形式 本项目依赖redis,使用redis的缓存以及原子操作实现秒杀活动 依赖的包 StackExchange.Redis  该包的作用类似 ...

  2. Vuex----Actions

    Actions用于处理异步任务. 如果通过异步操作变更数据,必须通过 Action,而不能使用Mutation,但是在 Action中还是要通过触发Mutation的方式间接变更数据. 注意: 在Ac ...

  3. What is RSS

    What is RSS?RSS (Rich Site Summary) is a format for delivering regularly changing web content. Many ...

  4. 使用NTC计算温度,增加计算精度的算法

    uint16_t uGetPCB_Temperature(void) { uint16_t x; float Adcn; float k; Adcn = userADC_var.ADCMeasureV ...

  5. Hyperkernel验证实验的复现与z3环境初识

    Hyperkernel验证实验的复现与z3环境初识 前言 建议顺序阅读本文!禁止转载.--@CarpVexing(https://www.cnblogs.com/CarpVexing/p/159483 ...

  6. vue省市区级联

    省市区级联 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <tit ...

  7. java中String为什么设计成不可变对象

    设计成不可变对象为了安全和高效 1.安全方面:举例说明:在文件操作或反射操作的时候需要传递字符串,如果是设计成可变的那么就会造成安全问题 2.高效:举例说明 字符串源码中会将hashcode缓冲下来, ...

  8. 将map转成vo实体

    //将map转成vo实体 AssetManagementProductsVO param= JSON.parseObject(JSON.toJSONString(map), AssetManageme ...

  9. MAC范洪攻击-macof

    macof 目的:攻击交换机的路由表,实现网络信息嗅探 macof是dsniff中的一个小工具 概要:交换机中存在着一个记录着MAC地址的表,为了完成数据的快速转发,这个表有着自动学习机制,学习后可以 ...

  10. 如何使用Github创建一个仓库

    创建仓库(对我来说,这是新建) 点击这里的Create repository: 进入到这样一个界面: 其中,Repository name,是我们即将创建完成的仓库名称: 而这里: 需要填写的是对仓库 ...