I am working a number of projects that are using Dropwizard 0.8.2 with sfl4j-api 1.7.12 for logging. Our chosen implementation for slf4j is slf4j-log4j12, but we are having a problem with multiple implementations present in the project.
When trying to run it, it complains that multiple SLF4J bindings are present. One is ours, the other is logback-classic which is coming from the dropwizard-jackson dependency.
The problem is when we try to exclude logback-classic from the dependencies we get the following error when trying to start the server:
Exception in thread "main" java.lang.NoClassDefFoundError: ch/qos/logback/classic/filter/ThresholdFilter
at io.dropwizard.Application.<clinit>(Application.java:20)
Caused by: java.lang.ClassNotFoundException: ch.qos.logback.classic.filter.ThresholdFilter
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 1 more
Is there any way that people know of to use log4j with Dropwizard?