Hide Forgot
I have discussion with WS developers and we would like to see some guide/doc to point us which jar/dependency is preferred by production. Example: WS team is using slf4j-log4j12 quite commonly and maven repo zip doesn't contain this artifact and there are some artifacts (e.g. org.opensaml:openws) which have transitive dependency on org.slf4j:log4j-over-slf4j. And when there are both artifacts on classpath we can see SLF4J: Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, preempting StackOverflowError and issues with tests execution: org.apache.maven.surefire.util.SurefireReflectionException ... Caused by: java.lang.NoClassDefFoundError: Could not initialize class We have workaround to disable slf4j-log4j12 dependency when using productized bits, but we would like to see some guide/doc to point us which jar/dependency is preferred by production.
The general rule for preferred artifacts, is to use what is included in the EAP runtime. Since neither of these artifacts (slf4j-log4j12 or log4j-over-slf4j) are in the runtime, I would defer to the dev team to make a recommendation, for each case like this. From productization perspective there is not really any difference, but if one is chosen over the other, then we can add it to the Maven repo, and then use the contents of the Maven repo to track which artifacts are preferred.
slf4j is a logging facade. slf4j-log4j12 is the binding to log messages from slf4j loggers to the lgo4j log manager. The log4j-over-slf4j library just uses a log4j logger and delegates to slf4j (at least that's what I think it does). The bottom line is we shouldn't be using either in production with EAP. In EAP we use jboss-logmanager and we have our own slf4j bindings to talk to jboss-logmanager.
Moving back to Paul, slf4j related items were explained by James. I still need your feedback for "... we would like to see some guide/doc to point us which jar/dependency is preferred by production." part.