Automatic Configuration

Log4j has the ability to automatically configure itself during initialization. When Log4j starts it will locate all the ConfigurationFactory plugins and arrange then in weighted order from highest to lowest. As delivered, Log4j contains three ConfigurationFactory implementations: one for JSON, one for YAML, and one for XML.

  1. Log4j will inspect the "log4j.configurationFile" system property and, if set, will attempt to load the configuration using the ConfigurationFactory that matches the file extension.
  2. If no system property is set the YAML ConfigurationFactory will look for log4j2-test.yaml or log4j2-test.yml in the classpath.
  3. If no such file is found the JSON ConfigurationFactory will look for log4j2-test.json or log4j2-test.jsn in the classpath.
  4. If no such file is found the XML ConfigurationFactory will look for log4j2-test.xml in the classpath.
  5. If a test file cannot be located the YAML ConfigurationFactory will look for log4j2.yaml or log4j2.yml on the classpath.
  6. If a YAML file cannot be located the JSON ConfigurationFactory will look for log4j2.json or log4j2.jsn on the classpath.
  7. If a JSON file cannot be located the XML ConfigurationFactory will try to locate log4j2.xml on the classpath.
  8. If no configuration file could be located the DefaultConfiguration will be used. This will cause logging output to go to the console.

ref: http://logging.apache.org/log4j/2.x/manual/configuration.html

没细看,应该默认不支持properites了

log4j2.x 配置文件默认寻找顺序的更多相关文章

  1. springcloud的配置文件的读取顺序

    SpringBoot默认支持properties和YAML两种格式的配置文件.前者格式简单,但是只支持键值对.如果需要表达列表,最好使用YAML格式.SpringBoot支持自动加载约定名称的配置文件 ...

  2. $Django importlib与dir知识,手写配置文件, 配置查找顺序 drf分页器&drf版本控制

    1  importlib与dir知识 # importlib简介动态导入字符串模块 # 常规导入 from ss.aa import b from ss import a print(b,type(b ...

  3. log4j2的配置文件log4j2.xml笔记

    一.背景 最近由于项目的需要,我们把log4j 1.x的版本全部迁移成log4j 2.x 的版本,那随之而来的slf4j整合log4j的配置(使用Slf4j集成Log4j2构建项目日志系统的完美解决方 ...

  4. struts几个配置文件加载顺序_2015.01.04

    struts几个配置文件加载顺序: 01:struts-default.xml 02:struts-plugin.xml 03:struts.xml 04:struts.properties 05:w ...

  5. bash 的配置文件加载顺序

    bash配置文件的加载顺序和登陆方式有关,下面先介绍下登陆方式. 1 登陆方式有2种 登陆式SHELL: su - oracle    su -l oracle 正常从终端登陆 非登录式SHELL: ...

  6. Linux之Ubuntu与Windows更改默认启动顺序[转载]

    装双系统后,经常会遇到与Windows更改默认启动顺序的需要,这样有助于开机时可以避免手动选择经常使用的系统了. 当然这解决办法不是博主的主意,本文纯属抄録者,故文章题目也声明了是转载,解决方案如下叙 ...

  7. Unity3d中默认函数调用顺序(MonoBehaviour)

    首先要明确的是MonoBehaviour是每个脚本的基类.每个Javascript脚本自动继承MonoBehaviour.使用C#或Boo时,需要显式继承MonoBehaviour.         ...

  8. 更改win10和mint双系统默认启动顺序

    更改win7 & Linuxmint双系统安装后更改默认启动顺序 1.打开一个term,编辑/etc/default/grub,即sudo nano /etc/default/grub,把se ...

  9. struts2配置文件加载顺序

    struts2配置文件加载顺序: struts-default.xml/ struts-plugin.xml/ struts.xml/ struts.properties/ web.xml

随机推荐

  1. 34. 求e的近似值

    求e的近似值 #include <stdio.h> double fact (int n); int main() { int i, n; double item, sum; while ...

  2. HTTP 笔记与总结(8)HTTP 与内容压缩

    以环球网的一篇新闻为例,抓包图: (Powered-By-ChinaCache:HIT from 060120b3g7.16 表示当前页面不是来自环球网的主服务器,而是来自中国的缓存服务器节点,HIT ...

  3. HTTP 笔记与总结(6)referer 头与防盗链

    在百度贴吧(或 QQ 空间等)中找到一张图片,复制图片地址,在站外通过 img src 引用,会发现: 此外,在一些统计软件中,统计访客的来路(直接访问.外部链接.搜索引擎),都用到了 HTTP 协议 ...

  4. ThinkPHP 3.2.2 在 volist 多重循环嵌套中使用 if 判断标签

    今天在 ThinkPHP 3.2.2 的试图模板中使用多重循环,用来把相应类别下对应的文章都依次循环出来,但是无论如何只能循环出类别,类别下的文章无法循环出,( 错误 ) 代码如下: <voli ...

  5. 实现Fragment 切换时不重新实例化

    以前实现Fragment的切换都是用replace方法实现 public void startFragmentAdd(Fragment fragment) { FragmentManager frag ...

  6. 制作支持UEFI PC的Server2008 R2系统安装U盘

    下载R2系统 ISO ed2k://|file|cn_windows_server_2008_r2_standard_enterprise_datacenter_and_web_with_sp1_x6 ...

  7. 20145317彭垚 《Java程序设计》第10周学习总结

    20145317彭垚 <Java程序设计>第10周学习总结 教材学习内容总结 网络编程 网络编程对于很多的初学者来说,都是很向往的一种编程技能,但是很多的初学者却因为很长一段时间无法进入网 ...

  8. maven 的一些基本操作

    maven  install :把打出的包装载到本地仓库,package:是打包的意思 每当项目中的模块里的东西发生变化的时候,先install一下项目 ,在启用maven的tomcat插件就不会报错 ...

  9. HTML5 测验记录

    结果:11/20 您的回答: 1.HTML5 之前的 HTML 版本是? 您的回答:HTML 4 正确答案:HTML 4.01 2.HTML5 的正确 doctype 是? 您的回答:<!DOC ...

  10. VB动态添加WebBrowser控件,并拦截弹出窗口(不用引用任何组件)

    新建空白窗体,然后粘帖下面代码: Option ExplicitPublic WithEvents br As VBControlExtender Private Sub br_ObjectEvent ...