0
votes

I have just met situation like that, I created default Spring framework from Spring tool suite, it will use slf4j and log4j for log everything into console.

After that, I add Spring security oauth dependency to maven, this dependency tree like :

spring security oauth --> spring boot --> spring boot starter --> logback(another logger).

The problem is my project had a logger, now spring boot add another logger, this make my logger work so strange (I used log4j.xml in classpath, level of logger is info but it print everything in debug level).

After I exclude logback from spring security oauth dependency from maven, log worked great, but I'm afraid of if I removed logback from spring boot starter, somewhere in this lib need logback, does it throw ClassNotFoundException?

Thanks in advance!

Update:

I copied pom file of spring security oauth2 from it's folder:

<dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter</artifactId>
        <version>1.0.0.RELEASE</version>
</dependency>
1

1 Answers

1
votes

Spring Security OAuth does not rely on Spring Boot. You probably have a different dependency that brings that.

Anyway, you can safely exclude logback, yes. Check also the documentation for more details.