Big Guy
Big Guy

Reputation: 334

How to disable all SLF4J messages

I am writing a simple five class command line application. I am using a serial port library jssc which has SLF4J implemented. Because of this I get the following text to the console:

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.

I have read the various questions and answers and have downloaded the slf4j-nop-1.7.9.jar which is in the class path for the project.

I do not want nor need logging for this application. It runs from the command line, does its 10 seconds worth of work, and ends. No logging required at all. How do I get rid of even the most basic of SLF4J messages?

BTW, I can see org.slf4j.impl.StaticLoggerBinder.class in the slf4j-nop-1.7.9.jar in the class path, yet it fails to load. Why?

And finally, why is this so complex? I just want it to shut up!

Upvotes: 0

Views: 496

Answers (1)

Big Guy
Big Guy

Reputation: 334

Ok, I found the problem. You do need the slf4j-nop-1.7.9.jar. You also need to add the noop jar to the project Run Configuration/ Dependencies tab

Sigh...

Upvotes: 1

Related Questions