I am new to spring boot and when I try to start my server , I get the following Exception. I understand that this has something to do with dependency conflict, but still una
Finally resolved this issue by excluding the Logback dependency and explicitly adding the log4j dependency
Excluding logback-classic from spring-boot-starter-web and spring-boot-starter-actuator worked for me
compile("org.springframework.boot:spring-boot-starter-web:1.1.10.RELEASE") {
exclude module: "spring-boot-starter-tomcat"
exclude module: "spring-boot-starter-logging"
exclude module: "logback-classic"
}
compile("org.springframework.boot:spring-boot-starter-actuator:1.1.10.RELEASE") {
exclude module: "logback-classic"
}
the following configuration in my gradle.build file worked for me:
configurations {
all*.exclude group: "org.springframework.boot", module: "spring-boot-starter-logging"
all*.exclude group: "ch.qos.logback"
all*.exclude group: "org.slf4j", module: "log4j-over-slf4j" // allow using log4j 2.x
all*.exclude group: "org.slf4j", module: "slf4j-simple" // log4j is the configured backend
}
Gradle solution is adding below lines in build.gradle :
configurations {
all*.exclude module : 'spring-boot-starter-logging'
}
Repeat answer but you can use Eclipse to exclude the spring-boot-starter-logging dependency
e.g enter image description here
Spring Boot supports Log4j 2 for logging configuration if it is on the classpath. If you use the starters for assembling dependencies, you have to exclude Logback and then include log4j 2 instead.