Question

It's a third party application generating huge amounts of logentries on our appserver. 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

Was it helpful?

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:

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

For log4j it is very similar.

OTHER TIPS

Alternatively, download http://www.slf4j.org/dist/slf4j-1.6.4.tar.gz, look in there for slf4j-nop-1.6.4.jar (this is the no-operation logger) and include this in your classpath. When the SLF4J classloader sees this (it looks to see what loggers are in the classpath that it can use), it should stop logging (once you've restarted the app).

At least this way you don't need to mess with the log configuration files...

Which logging back-end, e.g. logback, log4j, j.u.l., are you using? You need to configure the backend to filter those messages.

Moreover, the fact that the log messages point to "org.slf4j.impl.JCLLoggerAdapter" indicates that caller location inference is not working correctly. (It should mention the actual caller not JCLLoggerAdapter). This can happen if:

  1. you are using an older version of SLF4J

or

  1. the caller is using a slf4j-like wrapper or has its own homegrown logging API which does not infer caller location properly. See also a relevant SLF4J FAQ entry.

slf4j is a logging facade for various logging frameworks. That output comes from the Apache Commons Loggin framework adapter, that turns to be another facade. Commons Logging Configuration.

Search for the following string: level="DEBUG" using your IDE. You will find that text in a .xml file.

Go there and use level="INFO" instead of level="DEBUG".

The key value is not case-sensitive.

There can be something like:

<root level="info">
    ...
</root>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top