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" ..../>
  • 相关阅读:
    联考20200604 T2 宝石
    联考20200604 T1 旅游
    联考20200603 T2 排列
    [HAOI2017]八纵八横
    联考20200603 T1 解码
    [POI2011]KON-Conspiracy
    CF917D Stranger Trees
    CF1278F Cards
    CF809E Surprise me!
    NOI2016 循环之美
  • 原文地址:https://www.cnblogs.com/jybky/p/12204586.html
Copyright © 2011-2022 走看看