1
votes

I am running Junit testcase with sl4j loggers, But I dont see loggers getting printed on console/file at all. I have some generated classes where the flow goes while debugging and hence I cant change the implementation. Here is the error in console : SLF4J: No SLF4J providers were found. SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#noProviders for further details. SLF4J: Class path contains SLF4J bindings targeting slf4j-api versions prior to 1.8. SLF4J: Ignoring binding found at [jar:file:/C:/Users/A321300/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.11.2/log4j-slf4j-impl-2.11.2.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#ignoredBindings for an explanation.

I am using : import org.slf4j.Logger; import org.slf4j.LoggerFactory;

Can somebody pls help with the resolution.

1

1 Answers

0
votes

log4j-slf4j18-impl should be used with SLF4J 1.8.x releases or newer.

Applications that take advantage of the Java Module System should use SLF4J 1.8.x and log4j-slf4j18-impl.

Source: https://logging.apache.org/log4j/2.x/log4j-slf4j-impl/index.html