I'm getting the following error. It seems there are multiple logging frameworks bound to sl4j. Not sure how to resolve this. Any help is greatly appreciated.
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/admin/.m2/repository/org/slf4j/slf4j-log4j12/1.6.4/slf4j-log4j12-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/admin/.m2/repository/org/slf4j/slf4j-log4j12/1.6.1/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
I just ignored/removed that jar file.
Resolved by adding the following exclusion in the dependencies (of pom.xml) that caused conflict.
This issue took one whole day for me. Finally I decided to use not so good trick. Just put one of the below maven dependency in the very beginning of your pom.xml file. Use anyone of the file.slf4j-nop.jar, slf4j-simple.jar, slf4j-log4j12.jar, slf4j-jdk14.jar or logback-classic.jar , it should do the job. Note, use the latest jars from maven. Here's a link!. It is a good read. To understand you had to delete the slf4j jars created in local repository (in my case folder named ".m2") and run your project as Maven clean and Maven install and watch all the maven jars being downloaded. And you will figure out how JVM is picking the latest one (jar) for our program. To understand further,please remove the the POM dependency from the pom.xml file and again go to local repository and delete the all SLF4J jars and re-run the project as Maven clean and maven install , and makesure you watch for the downloads that are happening through maven, and then run your application to see the affect. You may notice that error or exception will not throw on placing or mentioning the dependency in the beginning this is because JVM is looking at the first come first jar in our project.But this is not good move. I would say use execlusion in the api's or jars where you find that particular api is downloading the slf4j jar. Something I noticed was, few jars (ex: hibernate annotations etc) are downloading slf4j when we build maven project. And that is the reason multiple slf4j jars getting injected in to our project.I hope this will help. This is just my experience.
I solved by delete this:spring-boot-starter-log4j2
Just use only required dependency, not all :))). For me, for normal work of logging process you need this dependency exclude others from pom.xml