[slf4j-user] Still getting log output when using slf4j-nop.jar

Ceki Gulcu ceki at qos.ch
Wed Nov 11 17:19:05 CET 2009


Hi Bart,

Well, when slf4j-api binds with a logging framework, it does so
completely. So either slf4j-nop is bound and you get no logs generated
by slf4j or slf4j is bound to another framework in which case you
would get many different logs from various sources. It really looks
like the "Fatal error" your are getting is not related to SLF4J nor
generated through it.

HTH,

Bart Nagel wrote:
> Hi, folks. I'm using a library (JQTI) which uses SLF4J and want to 
> discard all of its log output (or capture it to files, but discarding 
> it ought to be simpler for now).
> 
> I understand that this is what slf4j-nop.jar is for, so my classpath 
> is
> .:/usr/share/java/slf4j-api.jar:/usr/share/java/slf4j-nop.jar:lib/JQTI-2.0a4.jar
> 
> But when I'm running my program I'm still getting a line on stderr:
> [Fatal Error] :10:39: The element type "what" must be terminated by the matching end-tag "</what>".
> 
> It comes along with an org.xml.sax.SAXParseException which I am 
> catching. (The output appears whether I catch the exception or not.) 
> This error is expected, but I want to process and handle it myself 
> rather than seeing the output which would go to the logger.
> 
> I've grepped the JQTI library's code for System.out and System.err and 
> nothing appears. It's definitely not my own code.
> 
> I hadn't considered this until just now but could it in fact be 
> hardcoded output in SAX? But I want to be sure it's not something I'm 
> doing wrong with how I'm using SLF4J first.
> 
> Thanks
> --bart nagel

-- 
Ceki Gülcü
Logback: The reliable, generic, fast and flexible logging framework for Java.
http://logback.qos.ch



More information about the slf4j-user mailing list