Using SLF4J logging in TIBCO StreamBase

Using SLF4J logging in TIBCO StreamBase

book

Article ID: KB0074461

calendar_today

Updated On:

Products Versions
TIBCO Streaming 7

Description

Using SLF4J logging front end and alternative back-end loggers

Environment

This does not apply to TIBCO Streaming 10.x or later which does not use the SLF4J logger.

Resolution

If you are use SLF4J in your code and logging isn't working as expected, be aware that StreamBase bundles SLF4J with the product. If you force the SLF4J jar files to load before the StreamBase client jar (sbclient.jar), your logging may start working as expected, but StreamBase platform logging may be compromised.

By default StreamBase uses SLF4J with Logback logging. See the following section of our documentation on configuring StreamBase to use a different back end: Using StreamBase Logging

If you see console logging errors like this:
SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/opt/streambase/lib/slf4j-log4j12-1.6.3.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/opt/streambase/lib/sbclient.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

It means that some other SLF4J implementation besides the one in sbclient.jar was found on the classpath.

You may either configure StreamBase to NOT supply SLF4J (see the above documentation link), or you may remove the alternative implementation from your classpath configuration.

Issue/Introduction

Using SLF4J logging