好吧,以下代码可以工作,但它看起来并不好看.我有一个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)