错误信息

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. PTA1003 我要通过! (20 分)

    PTA1003 我要通过! (20 分) "答案正确"是自动判题系统给出的最令人欢喜的回复.本题属于 PAT 的"答案正确"大派送 -- 只要读入的字符串满足下 ...

  2. nodejs的增删改查

    1.新建一个jwttest.router.js 引入toast const {success,fail} = require("../toast"); const jwt = re ...

  3. vue 组件之间事件触发($emit)与event Bus($on)的用法说明

    组件之间事件触发 新增按钮组件: 操作按钮组合组件: 此时有个需求就是,无论是哪个按钮,如果改变了列表中的数据,列表需要实时更新数据. 此时就需要用到组件间的事件触发. 父子组件之间事件触发可以使用$ ...

  4. java接口自动化需要的技术

    1.testNG需要了解的知识 ITestContext这个类可以直接在方法参数里使用,主要作用是可以通过它的context.getSuite()直接获取suite的相关信息.还可以通过它的 cont ...

  5. shell脚本基本介绍

    1.编程介绍 驱动 硬件默认是不能使用的 CPU控制硬件.不同的厂家硬件设备之间需要进行指令沟通,我们需要驱动程序来进行"翻译": 更趋近与开发的工程师,要学习"汇编语言 ...

  6. SpringBoot - Lombok使用详解3(@NoArgsConstructor、@AllArgsConstructor、@RequiredArgsConstructor)

    五.Lombok 注解详解(3) 5,@NoArgsConstructor 注解在类上,为类提供一个无参的构造方法. 注意: 当类中有 final 字段没有被初始化时,编译器会报错,此时可用 @NoA ...

  7. CentOS7 安裝DHCP服務並啟用DHCP failover

    1. 安裝dhcp服務 yum install -y dhcp 2. host1 vi /etc/dhcp/dhcpd.failover failover peer "dhcpfailove ...

  8. nextcloud file location

  9. ubuntu16.04+win10双系统安装

    先下载Ubuntu到电脑:http://mirrors.ustc.edu.cn/ubuntu-releases/16.04.6/ubuntu-16.04.6-desktop-amd64.iso 准备个 ...

  10. centos docker 部署.net6项目

    1 .生成dockerfile文件 FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base WORKDIR /app EXPOSE 5000 # 一般情况下必 ...