I\'ve got a maven & spring app that I want logging in. I\'m keen to use SLF4J.
I want to put all my config files into a directory {classpath}/config including lo
In addition to Jatin's answer:
Spring uses Jakarta Commons Logging as a logging API. In order to log to slf4j, you need to make sure commons-logging
is not on the classpath. jcl-over-slf4j
is a replacement jar for commons-logging.
If you're using maven, you can detect where commons-logging comes from using mvn dependency:tree
and exclude it from all dependencies that require it using dependency exclusions. You might need to run mvn dependency:tree
several times though, because it only shows the first occurence of a transitive dependency.
org.springframework
spring-context
${org.springframework.version}
commons-logging
commons-logging