小编Max*_*son的帖子

Gradle从Spring中排除SLF4J

好吧,以下代码可以工作,但它看起来并不好看.我有一个Spring Boot项目,我想排除SLF4J,因为我想使用Log4j2.

有谁知道如何改进代码?

dependencies {
    compile("org.springframework:spring-context") {
        exclude module: "spring-boot-starter-logging"
        exclude module: "logback-classic"
    }
    compile("org.springframework.boot:spring-boot-starter-web") {
        exclude module: "spring-boot-starter-logging"
        exclude module: "logback-classic"
    }
    compile("org.springframework.boot:spring-boot-starter-data-mongodb") {
        exclude module: "spring-boot-starter-logging"
        exclude module: "logback-classic"
    }
    compile("org.springframework.boot:spring-boot-starter-log4j2")
    providedRuntime("org.apache.tomcat.embed:tomcat-embed-jasper")
    testCompile("junit:junit")
}
Run Code Online (Sandbox Code Playgroud)

logging spring log4j gradle spring-boot

5
推荐指数
1
解决办法
7452
查看次数

标签 统计

gradle ×1

log4j ×1

logging ×1

spring ×1

spring-boot ×1