You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@logging.apache.org by Nilay Prafulla Dhamecha <np...@tibco.com.INVALID> on 2022/07/14 07:35:54 UTC

Need assistance regarding warning - Class path contains multiple SLF4J bindings

Hi,
We have recently migrated our logging framework from log4j1.x to log4j2.17.1

Below are the jars we are using currently in our project.
*Please note that we do not have a Mavan/Gradle based project, the
dependencies are managed manually.*

*Jars : *







*log4j-api-2.17.1log4j-appserver-2.17.1log4j-core-2.17.1log4j-slf4j-impl-2.17.1slf4j-api-1.7.31slf4j-log4j12-1.7.31slf4j-simple-1.7.31*

*During the project startup we see multiple warning messages as shown
below:*

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in
[jar:file:/lib/slf4j-log4j12-1.7.31.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in
[jar:file:/lib/slf4j-simple-1.7.31.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in
[jar:file:/lib/log4j-slf4j-impl-2.17.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]


We are trying to either fix this warning or hide the warning messages from
the console but we are unable to do so.
Is there any property by which we can hide these or any other way to do the
same?

Any pointers regarding fixing/hiding the warnings will be helpful.

Regards,
Nilay

Re: Need assistance regarding warning - Class path contains multiple SLF4J bindings

Posted by "Piotr P. Karwasz" <pi...@gmail.com>.
Hi Nilay,

On Thu, 14 Jul 2022 at 09:36, Nilay Prafulla Dhamecha
<np...@tibco.com.invalid> wrote:
> SLF4J: Class path contains multiple SLF4J bindings.
> SLF4J: Found binding in
> [jar:file:/lib/slf4j-log4j12-1.7.31.jar!/org/slf4j/impl/StaticLoggerBinder.class]
> SLF4J: Found binding in
> [jar:file:/lib/slf4j-simple-1.7.31.jar!/org/slf4j/impl/StaticLoggerBinder.class]
> SLF4J: Found binding in
> [jar:file:/lib/log4j-slf4j-impl-2.17.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
>
>
> We are trying to either fix this warning or hide the warning messages from
> the console but we are unable to do so.
> Is there any property by which we can hide these or any other way to do the
> same?

The warning is quite explicit regarding the nature of the problem:
remove the SLF4J bindings you don't need (probably `slf4j-log4j12` and
`slf4j-simple`) and the message will disappear.

Piotr