I will tell about a special case.
I was working on a simple discardable prototype (using easy-rules) which had a sfl4j dependency.
I get an error telling me wich some providers were not provided, and i have to add another dependency.
I add such dependency in pom.xml and get the logging working.
But still the «SLF4J(I): Connected with provider of type [org.slf4j.simple.SimpleServiceProvider]» was appearing (which I didn't wanted to appear).
At the end, I came to the slf4j-api-xxx.jar and I found that the verbosity was caused because a java system property "slf4j.internal.verbosity".
After a time I figured out that the only thing I could do is disabling it by:
System.setProperty("slf4j.internal.verbosity", "WARN") //Because it defaults to INFO.
Finally, because I had written a «simplelogger.properties» file:
org.slf4j.simpleLogger.defaultLogLevel=info
slf4j.internal.verbosity=WARN
I decided to use such file in my main method this way:
public static void main(String[] args) throws Exception {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
hideLoggingProviderData(classLoader);
...
}
private static void hideLoggingProviderData(ClassLoader classLoader) throws IOException {
Properties loggingProperties = new Properties();
loggingProperties.load(classLoader.getResourceAsStream("simplelogger.properties"));
Object obj = loggingProperties.get("slf4j.internal.verbosity");
if (obj!=null) {
System.setProperty("slf4j.internal.verbosity", obj.toString());
}
}
And then I get ride off that (for me) useless message.