[slf4j-user] Recommendation for library writers: use thiscopy and paste wrapper around SLF4j to avoid default static initialization

Ceki Gülcü ceki at qos.ch
Sat Mar 18 21:50:14 CET 2017



On 3/18/2017 21:26, Adam Gent wrote:

> Because you now have to put all your initialization configuration
> (like calling discovery services like zookeeper or consul) in the
> backend logging framework and this is because the logging framework
> almost always runs first unless you are extremely judicious about what
> libraries you use to setup your application.
>
> The real issue is you may need to configure the backend logging framework.
>
> And this hard because we are in a cloud world where yeah you have to
> connect a whole bunch of things to get configuration and those clients
> need to do logging. This is a real problem that both dropwizard and
> spring know about.


I don't follow you. Can you give simplified example of the chicken and 
egg problem? Do you mean for example logback configuration which has as 
DBAppender writing to a database with a JDBC connector which itself uses 
slf4j for logging? This should work with the aforementioned event replay 
mechanism. Any other examples?

--
Ceki



More information about the slf4j-user mailing list