Can someone please help me with instructions on how to configure my Java application (using Dropwizard) to log via Log4j2 ?
I have custom Log4j2 apppenders already coded that I need to use and Dropwizard seems to use logback by default, I cannot seem to find the exact information of how to override this.
(1) I have updated my pom.xml with (slf4j-api, log4j-slf4j-impl, log4j-core, log4j-api)
(2) I run my application with : java -jar -Dlog4j.configurationFile=log4j2.xml app-1.0-SNAPSHOT.jar server configuration.yaml
and I get the exception :
Exception in thread "main" java.lang.IllegalStateException: Unable to acquire the logger context
at io.dropwizard.logging.LoggingUtil.getLoggerContext(LoggingUtil.java:46)
at io.dropwizard.logging.BootstrapLogging.bootstrap(BootstrapLogging.java:45)
at io.dropwizard.logging.BootstrapLogging.bootstrap(BootstrapLogging.java:34)
at io.dropwizard.Application.<init>(Application.java:24)
....
Thanks in advanced!