[slf4j-user] Fwd: SLF4J Warning - Loggers will not work as they were created during initialization phase

Joachim Durchholz jo at durchholz.org
Mon Jan 15 22:08:13 CET 2018


Am 15.01.2018 um 20:14 schrieb Debraj Manna:
> |SLF4J:Thefollowing loggers will not work because they were created 
> SLF4J:during the defaultconfiguration phase of the underlying logging 
> system.SLF4J:Seealso http://www.slf4j.org/codes.html#substituteLogger 
> <http://www.slf4j.org/codes.html#substituteLogger>SLF4J:com.vnera.healthandmetrics.VneraMetrics|

> Can some one let me know what does the SLF4J warning denotes?

It denotes that some loggers were created and initialized before SLF4J 
was created.
I can only guess, but the message seems to indicate that these loggers 
will not cleanly integrate into SLF4J, i.e. logging will not work as 
advertised (I could imagine things like using the wrong configuration 
and such). Which can be nasty and surprising (hats off to Ceci for even 
detecting the problem).

The solution would be to cause SLF4J initialization before the first 
logging call happens.
It's a bit surprising that a Dropwizard application has this kind of 
problem; From its website, I infer that they're using Logback, which 
sort-of indicates that they should be using SLF4J anyway.
Maybe you're initializing other code before the Dropwizard code starts, 
and THAT code is using log4j or whatever other logging framework there 
might be. In this case, you'd just have to make sure that logging is 
initialized before anything else happens.

Or you have more than one logging facade in the application, and the two 
are fighting over the loggers.


More information about the slf4j-user mailing list