0

I have to refactor a custom ant task to use a rewritten implementation of the code. As part of the rewrite, the logging library was updated from slf4j 1.7.26 to 2.0.17, using logback 1.5.28, updated from 1.2.3

The task itself completes, but none of the logging statements are added to the log, and the following is included in the log

[myCustomTask] SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
[myCustomTask] SLF4J: Defaulting to no-operation (NOP) logger implementation
[myCustomTask] SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

According to the SLF4J website, this means that, at some point in the execution, it is trying to find the StaticLoggerBinder class, which was removed in the 2.x release

Running in debug mode adds this to the log

Class java.util.List loaded from parent loader (parentFirst)
Class java.util.Collection loaded from parent loader (parentFirst)
Class java.lang.invoke.MethodHandles loaded from parent loader (parentFirst)
Class java.lang.invoke.MethodHandles$Lookup loaded from parent loader (parentFirst)
Class org.slf4j.LoggerFactory loaded from parent loader (parentFirst)

I'm guessing that the ant jar is still using the older version of SLF4J, and is defaulting to this when the classes are loaded.

Is it possible to ignore this older version and use the 2.x release?

0

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.