zoukankan      html  css  js  c++  java
  • logback :<include>

     

    可以使用 <include> 标签在一个配置文件中包含另外一个配置文件,如下图所示:

    复制代码
    <configuration>
      <include file="src/main/java/chapters/configuration/includedConfig.xml"/>
    
      <root level="DEBUG">
        <appender-ref ref="includedConsole" />
      </root>
    
    </configuration>
    复制代码

    被包含的文件必须有以下格式:

    复制代码
    <included>
      <appender name="includedConsole" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
          <pattern>"%d - %m%n"</pattern>
        </encoder>
      </appender>
    </included>
    复制代码

    支持从多种源头包含
    从文件中包含

    <include file="src/main/java/chapters/configuration/includedConfig.xml"/>

    从 classpath 中包含

    <include resource="includedConfig.xml"/>

    从 URL 中包含

    <include url="http://some.host.com/includedConfig.xml"/>

    如果包含不成功,那么 logback 会打印出一条警告信息,如果不希望 logback 抱怨,只需这样做:

    <include optional="true" ..../>
  • 相关阅读:
    MongoDb
    js暴露内部方法属性等
    JS闭包
    k8s设计模式
    scrum
    死锁
    Linux下安装php 扩展fileinfo
    linux中whereis、which、find、location的区别和用法
    Linux 命令学习记录
    windows 下 redis 的安装及使用
  • 原文地址:https://www.cnblogs.com/jybky/p/12204586.html
Copyright © 2011-2022 走看看