Fuse: SLF4J API does not find a binding to a logging framework, when the API JAR is embedded in a bundle

Solution Unverified - Updated -

Issue

  • The recommended way for an application bundle to use the SLF4J logging API is to import the package org.slf4j in the bundle's manifest. If using Maven, then declaring a dependency on org.slf4j/slf4j-api/1.6.2 will 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-Dependency directive in Maven, or by explicitly installing the API JAR and referencing it using a Bundle-Classpath statement 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.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content