You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by Alexey Popov <ta...@gmail.com> on 2017/11/16 11:35:51 UTC

Confusing slf4j error messages

Hi Igniters,

Ignite examples and Ignite itself with some configurations prints out
annoying messages related to slf4j:

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.

The reason for these messages is inside
org.springframework.data:spring-data-commons. It adds a dependency to
jcl-over-slf4j that "activates" slf4j. slf4j then tries to find
slf4j-TO-SOMELOGGER to forward all messages to SOMELOGGER. Actually, it does
not result in any issues with Ignite logging itself, it just confusing
Ignite users.

So, there are two options here to avoid these annoying messages:
1. exclude jcl-over-slf4j dependency from spring-data-commons in Ignite .pom
files
2. add slf4j-TO-SOMELOGGER (for instance, slf4j-log4j12 for log4j, or
slf4j-simple) dependency

Please advice on a better solution here.

Thank you,
Alexey




--
Sent from: http://apache-ignite-developers.2346864.n4.nabble.com/

Re: Confusing slf4j error messages

Posted by Alexey Popov <ta...@gmail.com>.
I've opened a ticket https://issues.apache.org/jira/browse/IGNITE-6828 some
time ago to fix this message.

If nobody argues I will prepare a patch.

Thanks,
Alexey



--
Sent from: http://apache-ignite-developers.2346864.n4.nabble.com/

Re: Confusing slf4j error messages

Posted by Alexey Popov <ta...@gmail.com>.
It will utilize commons-logging (it is in dependency tree) according to
https://spring.io/blog/2009/12/04/logging-dependencies-in-spring/

"The nice thing about commons-logging is that you don’t need anything else
to make your application work. It has a runtime discovery algorithm that
looks for other logging frameworks in well known places on the classpath and
uses one that it thinks is appropriate (or you can tell it which one if you
need to). If nothing else is available you get pretty nice looking logs just
from the JDK (java.util.logging or JUL for short). You should find that your
Spring application works and logs happily to the console out of the box in
most situations, and that’s important."

Thanks,
Alexey





--
Sent from: http://apache-ignite-developers.2346864.n4.nabble.com/

Re: Confusing slf4j error messages

Posted by Nikolai Tikhonov <nt...@apache.org>.
Hello Alexey!

If we exclude this dependency, which logger will be used by spring
framework?

On Thu, Nov 16, 2017 at 2:35 PM, Alexey Popov <ta...@gmail.com> wrote:

> Hi Igniters,
>
> Ignite examples and Ignite itself with some configurations prints out
> annoying messages related to slf4j:
>
> 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.
>
> The reason for these messages is inside
> org.springframework.data:spring-data-commons. It adds a dependency to
> jcl-over-slf4j that "activates" slf4j. slf4j then tries to find
> slf4j-TO-SOMELOGGER to forward all messages to SOMELOGGER. Actually, it
> does
> not result in any issues with Ignite logging itself, it just confusing
> Ignite users.
>
> So, there are two options here to avoid these annoying messages:
> 1. exclude jcl-over-slf4j dependency from spring-data-commons in Ignite
> .pom
> files
> 2. add slf4j-TO-SOMELOGGER (for instance, slf4j-log4j12 for log4j, or
> slf4j-simple) dependency
>
> Please advice on a better solution here.
>
> Thank you,
> Alexey
>
>
>
>
> --
> Sent from: http://apache-ignite-developers.2346864.n4.nabble.com/
>