码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2016-11-26 23:04:28      阅读:264      评论:0      收藏:0      [点我收藏+]

标签:color   log   log4j2   config   2.x   bsp   报错   系统选择   作用   

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

log4j版本:log4j-core-2.7.jar   log4j-api-2.7.jar

log4j2只支持xml和json两种格式的配置,所以配置log4j.properties时,是没有作用的。

log4j 2.0与以往的1.x有一个明显的不同,其配置文件只能采用.xml, .json或者 .jsn。在默认情况下,系统选择configuration文件的优先级如下:(classpath为scr文件夹)

  1. classpath下名为 log4j-test.json 或者log4j-test.jsn文件
  2. classpath下名为 log4j2-test.xml
  3. classpath下名为 log4j.json 或者log4j.jsn文件
  4. classpath下名为 log4j2.xml

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

标签:color   log   log4j2   config   2.x   bsp   报错   系统选择   作用   

原文地址:http://www.cnblogs.com/Hugooscar/p/6105327.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!