Search code examples
javawebsphereslf4jlogback

Websphere Multiple slf4j logback bindings work around


I am running an application on Websphere v8.5.5.0 and am attempting to use logback as my logging framework.

When i try to start the application, I am greeted with an error similar to this one:

[10/03/14 13:19:00:900 EST] 00000097 SystemErr     R   SLF4J: Class path contains multiple SLF4J bindings.
[10/03/14 13:19:00:900 EST] 00000097 SystemErr     R   SLF4J: Found binding in [bundleresource://266.fwk1755217229:1/org/slf4j/impl/StaticLoggerBinder.class]
[10/03/14 13:19:00:900 EST] 00000097 SystemErr     R   SLF4J: Found binding in    [wsjar:file:/C:/Program%20Files%20(x86)/IBM/WebSphere/AppServer_1/profiles/AppSrv01/installedApps/AUSSYDCVTLJ007Node02Cell/myapp.ear/lib/logback-classic-1.1.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
[10/03/14 13:19:00:900 EST] 00000097 SystemErr     R   SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
[10/03/14 13:19:01:313 EST] 00000097 SystemErr     R   SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]

As the answer explains, The ibm libraries contain an implementation of the logback-classic library on the classpath already. I want to stay up to date with the latest logback so was wondering whether someone could show me how to manually choose the binding to use (without using a parent-last classloader!).


Solution

  • Actually the error messages you see in your case is a known bug of IBM WebSphere Application Server v8.5.5.0. The issue is that WAS is using is SLF4j internally but this implementation is supposed to be unknown (and unusable) from applications. Unfortunately, these error messages you see have not been blocked by the WAS framework but you can ignore them (except if you have not well used SLF4j). The good news is that this issue has been fixed in FixPack 3 (WAS 8.5.5.3). The bug is referenced by IBM Support here. So, update your WAS installation. If, after applying the fix, the error messages still occur, then, you probably have to review your SLF4J configuration and usage.

    John