在使用Spring Boot的时候,想更换默认的日志组件,一直使用的是Log4j,在build.gradle配置里加入下面代码,排除logback的依赖:
configurations {
compile.exclude group:'ch.qos.logback'
}
dependencies {
compile ("org.springframework.boot:spring-boot-starter-web") {
exclude module: 'org.springframework.boot:spring-boot-starter-logging'
}
compile ('org.springframework.boot:spring-boot-starter-log4j')
}