官方文档describes类路径配置(test -> groovy -> xml -> Configurator SPI
)和mention的优先级,系统属性名为logback.configurationFile
,用于指定外部配置。但是,如果产品在类路径中包含logback.xml并且用户使用logback.configurationFile
属性指定外部配置,该怎么办?哪个配置将加载classpath或external?
至少对于1.2.3版本(最新的稳定版本),该属性具有最高优先级。在ch.qos.logback.classic.util.ContextInitializer
方法中加载findURLOfDefaultConfigurationFile
类的配置