【发布时间】:2015-04-16 01:10:36
【问题描述】:
好吧,下面的代码可以工作,但看起来不太好。我有一个 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")
}
【问题讨论】:
标签: spring logging gradle log4j spring-boot