-3

In my pom.xml file, I found following dependencies, in my parent pom.xml contain logback-classic dependency and another module contain slf4j-api dependency,

   <dependency>
         <groupId>org.slf4j</groupId>   
         <artifactId>slf4j-api</artifactId>
         <version>${slf4j.version}</version>
    </dependency>

     <dependency>
         <groupId>ch.qos.logback</groupId>
         <artifactId>logback-classic</artifactId>
         <version>${logback.version}</version>
      </dependency>


logback-classic-1.0.13.jar!/org/slf4j/impl/StaticLoggerBinder.class
slf4j-simple-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class
DalusC
  • 391
  • 1
  • 12
  • The binding is in the `ch.qos.logback:logback-classic` and the slf4j dependency. The API can be in the `pom.xml` multiple times, at least if it is provided. – dan1st Sep 20 '19 at 06:45

1 Answers1

1

Following exclusion solved my problem.Dependency coming from spring boot. It also brought in log4j-over-slf4j, which clashed with my own requirement of slf4j-api. Solved by adding the exclusions below. This is more specific that excluding the spring boot logging.

<dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter</artifactId>
        <exclusions>
            <exclusion>
                <artifactId>logback-classic</artifactId>
                <groupId>ch.qos.logback</groupId>
            </exclusion>
            <exclusion>
                <artifactId>log4j-over-slf4j</artifactId>
                <groupId>org.slf4j</groupId>
            </exclusion>
        </exclusions>
</dependency>
DalusC
  • 391
  • 1
  • 12