javaloggingjakarta-eeslf4j

How to turn off logging from SLF4J?


It's a third party application generating huge amounts of log entries on our app server. Like this:

[03.03.10 15:21:57:250 CET] 00000180 FtpProtocolHa I org.slf4j.impl.JCLLoggerAdapter info Close connection : 10.227.10.10 - admin
[03.03.10 15:27:35:209 CET] 00000181 MinaFtpProtoc I org.slf4j.impl.JCLLoggerAdapter info [/10.227.10.10] CLOSED
++++

How do I turn this output from SLF4J off? I've looked in the .war file to find some configuration for SLF4J but nothing. Their website didn't help either.


Solution

  • slf4j is just a funnel to the actual log backend (here overriding jakarta commons logging), which is the one you must configure to get rid of a certain kind of messages. For logback this is the appropriate configuration snippet which goes in your logback.xml configuration file:

        <!--  No Tomcat debug logs -->
        <configuration>
        ...
            <logger name="org.apache.catalina.core" level="OFF" />
        ...
        </configuration>
    

    For log4j it is very similar.