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. ThinkPHP 学习笔记 ( 三 ) 数据库操作之数据表模型和基础模型 ( Model )

    //TP 恶补ing... 一.定义数据表模型 1.模型映射 要测试数据库是否正常连接,最直接的办法就是在当前控制器中实例化数据表,然后使用 dump 函数输出,查看数据库的链接状态.代码: publ ...

  2. Grand Theft Auto V 图形研究(3)

    原文链接 http://www.adriancourreges.com/blog/2015/11/02/gta-v-graphics-study-part-3/ Post Processing Eff ...

  3. Rails--bundle exec rake db:migrate

    --新建表: def up create_table :[TABLE_NAME] do |t| t.column :[NUM], :integer t.column :[NAME], :string ...

  4. Rails--export csv

    --controller def export_agent_impressions export_start_time = Time.parse(params[:es_time]) + 7.hours ...

  5. Bootstrap页面布局3 - BS布局以及流动布局

    1. <h1 class='page-header'>布局<small> 使用bootstrap网格系统布局网页</small></h1> 得到如图所示 ...

  6. Memory Allocation in the MySQL Server

    https://dev.mysql.com/doc/internals/en/memory-allocation-mysql-server.html MySQL Internals Manual  / ...

  7. mysql 权限篇

    mysql库 user(用户以及所有库权限配置) db(具体库权限配置) 配置完毕要用命令 FLUSH PRIVILEGES; 刷新权限 备份数据库可以直接copy文件的形式,不过这样copy的文件会 ...

  8. The Producer-Consumer Relationship

    //Listing 3-1. The Producer-Consumer Relationship Version 1 public class PC { public static void mai ...

  9. jquery mobile 方法收集.

    1.在列表项和按钮上禁用文本截断     如果你的列表项或者按钮上是一个很长的文本,它将会被jQuery Mobile自动截断,要禁用这个截断设置,需要在CSS选择器上添加属性"white- ...

  10. JNI字段描述符-Java Native Interface Field Descriptors

    一.JNI字段描述符 "[I" ---  int[] "[[[D" --- double[][][] 如果以一个L开头的描述符,就是类描述符,它后紧跟着类的字符 ...