newrelic-platform/metrics_publish_java — pull request #46 by ToneD (2014-06-01 06:23:58+00:00)
Title: Removed all integrated logging and standardised on slf4j

Hi,

I'm raising this pull request mainly for the purpose of discussion.

I am working on a plugin that is intended to be embedded in a java application. The application that it will be embedded in uses slf4j for logging with a log4j binding.

At runtime I get a warning indicating that there are multiple slf4j bindings in the classpath. The issue is detailed [here](http://www.slf4j.org/codes.html#multiple_bindings). I was able to get around this by using transient dependency exclusions. However once this is sorted out there is a follow up error originating from Logger.java:88

ClassCastException: org.slf4j.impl.Log4jLoggerFactory cannot be cast to ch.qos.logback.classic.LoggerContext

At this point I couldn't see a workaround that didn't involve a refactor of the embedded logging part of metics_publish_java. So I just pulled it all and standardised to slf4j.

It looks like you have included the embedded logging component to make development of plugins easier. I think this is probably a worthy goal for this library. I just wanted to point out that in the case where the plugin is to be embedded as a library into an application that is already managing slf4j bindings, it can actually make things harder.