Reference: http://www.mamicode.com/info-detail-1239074.html
The process of logback loading:
(1) Use the setting of the logback.configurationFile environment variable
(2) Use logback.groovy in classpath
(3) Use logback-test.xml in classpath
(4) Use logback.xml in classpath
(5) Find the com.qos.logback.classic.spi.Configurator interface implementation class, and call the configure method of the implementation class to set
(6) Use the configure method of the BasicConfigurator class to set
Other log libraries to slf4j:
<properties> <version.logback>1.2.1</version.logback> <version.slf4j>1.7.16</version.slf4j> </properties>
<!--******** logback and slf4j ******** --> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-core</artifactId> <version>${version.logback}</version> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>${version.logback}</version> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-access</artifactId> <version>${version.logback}</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>${version.slf4j}</version> </dependency>
<!--jul bridge to output Java Logging Framework (JUL) --> <dependency> <groupId>org.slf4j</groupId> <artifactId>jul-to-slf4j</artifactId> <version>${version.slf4j}</version> </dependency>
<!-- jcl bridge to output third-party Jakarta Commons Logging (JCL) --> <dependency> <groupId>org.slf4j</groupId> <artifactId>jcl-over-slf4j</artifactId> <version>${version.slf4j}</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>log4j-over-slf4j</artifactId> <version>1.7.16</version> </dependency>