ERROR StatusLogger Log4j2 could not find a logging implementation.
今天在学习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.的更多相关文章
- 使用Log4j2,打包后提示ERROR StatusLogger Log4j2 could not find a logging implementation.
从Log4j切换到Log4j2,没有打包之前日志输出正常,但是打包后总是提示下面内容: 错误一: ERROR StatusLogger Log4j2 could not find a logging ...
- 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 ...
- ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...
Struts2未配置Log4j2.xml报错 Log4j2.xml中的配置 log4j的jar包:log4j-core-2.7.jar log4j2只支持xml和json两种格式的配置,所以配置log ...
- 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 ...
- 测试中出现ERROR StatusLogger No log4j2 configuration file
概述 在hibernate框架搭建完成用log4j2进行测试时,总是出现ERROR StatusLogger No log4j2 configuration file found. Using def ...
- Log4j2报错ERROR StatusLogger Unrecognized format specifier
问题 使用maven-shade-plugin或者maven-assembly-plugin插件把项目打成一个可执行JAR包时,如果你引入了log4j2会出现如下问题: ERROR StatusLog ...
- Spring Boot ERROR StatusLogger No Log4j 2 configuration file found
1. 问题描述 项目之前的 log4j2 配置没问题,把 pom 文件中的 spring-boot-starter-web 依赖删除后,然后启动项目就报错找不到 log4j2.yml 文件. 之前引用 ...
- 教你搭建SpringMVC框架( 更新中、附源码)
一.项目目录结构 二.SpringMVC需要使用的jar包 commons-logging-1.2.jar junit-4.10.jar log4j-api-2.0.2.jar log4j-core- ...
- Knowledge_SPA——精研查找算法
首先保证这一篇分析查找算法的文章,气质与大部分搜索引擎搜索到的文章不同,主要体现在代码上面,会更加高级,会结合到很多之前研究过的内容,例如设计模式,泛型等.这也与我的上一篇面向程序员编程--精研排序算 ...
随机推荐
- POJ 2632 Crashing Robots (模拟 坐标调整)(fflush导致RE)
题目链接:http://poj.org/problem?id=2632 先话说昨天顺利1Y之后,直到今天下午才再出题 TAT,真是刷题计划深似海,从此AC是路人- - 本来2632是道略微恶心点的模拟 ...
- navicat for mysql 在Mac上安装后没有连接列表,就是左边的那一列连接项目怎么办?
在连接数处打对勾就可以了
- 在 Linux 启动或重启时执行命令与脚本
有时可能会需要在重启时或者每次系统启动时运行某些命令或者脚本.我们要怎样做呢?本文中我们就对此进行讨论. 我们会用两种方法来描述如何在 CentOS/RHEL 以及 Ubuntu 系统上做到重启或者系 ...
- JPA中id前面有空格导致的"Column 'id' not found"问题
问题背景 昨晚有个同事发生了一个神奇的问题,一如既往的问题,一如既然的用我写的BEJSON-JAVA代码生成器生成,却发现一直提示Column 'id' not found.这就很TM神奇了 2018 ...
- 【codeforces 798D】Mike and distribution
[题目链接]:http://codeforces.com/contest/798/problem/D [题意] 让你选一个下标集合 p1,p2,p3..pk 使得2*(a[p1]+a[p2]+..+a ...
- HZOJ 辣鸡(ljh)
题解?noipT1还需要题解?正解就是$n^2$大暴力. 考试的时候打了$n^2$的暴力,也想到了正解的优化,然而觉得它太麻烦了,而且$n^2$怎么优化也过不了50000啊,而且即使不优化前面30分我 ...
- 多版本python共存,安装三方库到指定python版本
多版本python安装过程略过不提提供完美解决python启动和各版本pip问题: python3下pip安装命令如下: py -3 -m pip install xxxxxx python2下pip ...
- oracle自动选择索引
如果表中有两个以上(包括两个)索引,其中有一个唯一性索引,而其他是非唯一性. 在这种情况下,ORACLE将使用唯一性索引而完全忽略非唯一性索引. 举例: SELECT ENAME FROM EMP W ...
- 【CSS3】使用CSS3制作全屏切换效果
在线演示: DEMO DEMO中及以下代码并没有写兼容代码,请使用高级浏览器打开,IE版本对CSS3支持并不太友好,IE11打开没有滚屏效果. 兼容代码前缀: -webkit- -moz- -o- - ...
- js中的数据类型及常用属性和方法
JavaScript 字符串 字符串(或文本字符串)是一串字符(比如 "Bill Gates").字符串被引号包围.您可使用单引号或双引号您可以在字符串内使用引号,只要这些引号与包 ...