Fuse: SLF4J API does not find a binding to a logging framework, when the API JAR is embedded in a bundle
Issue
-
The recommended way for an application bundle to use the SLF4J logging API is to import the package
org.slf4jin the bundle's manifest. If using Maven, then declaring a dependency onorg.slf4j/slf4j-api/1.6.2will be all that is required. Fuse provides an implementation of SLF4J which will link automatically to the API. -
If an application bundle instead embeds the SLF4J API jar by, for example, using the
Embed-Dependencydirective in Maven, or by explicitly installing the API JAR and referencing it using aBundle-Classpathstatement in the manifest, then the SLF4J API will not find the implementation provided by the Fuse container. Instead, the following error message will be displayed prominently in the console:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Environment
- Red Hat JBoss Fuse
- 6.0
- 6.1
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.