<div dir="ltr">You could always write your configuration bootstrapping another programming language!<div><br></div><div>In my experience, what I've usually done or seen done for managing this sort of configuration is through application startup scripts more so than pure Java. For example, using Mesos, I can set environment variables ahead of time. Using config management, I can have a program to configure my tasks before starting a Java executable entirely. It all really depends on the deployment environment you use. I'm also curious as to what other things you're doing before logging initialization is wanted.</div><div><br></div><div>Also, Commons Logging has been using the ServiceLoader method for a while, though again, as with all the logging frameworks, initialization happens as soon as you use a logger.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 19 March 2017 at 06:08, Joachim Durchholz <span dir="ltr"><<a href="mailto:jo@durchholz.org" target="_blank">jo@durchholz.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">Am 19.03.2017 um 05:50 schrieb Adam Gent:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I accidentally unsubscribed but I figured I would start a new thread<br>
on what I mean by the Chicken/Egg configuration problem with SL4FJ.<br>
<br>
The problem is you often in cloud environments want a fully resolved<br>
configuration with out doing logging.<br>
.... But you can't have fully correctly configured logging with out<br>
configuration being complete.... but you can't a proper configuration<br>
with out using logging.<br>
<br>
I'm not talking about some reentrant or endless recursive calls or<br>
infinite loop that the event queue in LogFactory prevents.<br>
<br>
Lets go over this with a configuration initialization that is agnostic<br>
of logging backend.<br>
<br>
1. static main - initialization<br>
2. configuration code begins<br>
3. configuration needs to set some system properties and various<br>
singletons required by a backend logging framework and various other<br>
downstream libraries (the best way to configure old log4j is still<br>
through system properties)<br>
4. configuration code needs to get external configuration to set these<br>
properties<br>
5. configuration code uses a library that has SLF4J in it (lets say<br>
Zookeeper but it could be any sort of configuration library like<br>
Archaius).<br>
5. SLF4J initialization begins<br>
6. Backend logging initialization begins but is missing required<br>
system properties and/or singletons.<br>
</blockquote>
<br></div></div>
How this?<br>
Step 3 is supposed to provide all this.<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
7. Backend logging finishes initialization but is incorrect<br>
8. Logging events do not have correct MDC attributes but worse Logging<br>
appenders may not be setup correctly.<br>
</blockquote>
<br></span>
Since we disagree about what problems can happen, I'm leaving discussion of the solutions to another thread.<br>
<br>
(I do believe you that you did have problems, I just do not agree with the problem description because it doesn't make sense to me - yet.)<div class="HOEnZb"><div class="h5"><br>
______________________________<wbr>_________________<br>
slf4j-user mailing list<br>
<a href="mailto:slf4j-user@qos.ch" target="_blank">slf4j-user@qos.ch</a><br>
<a href="http://mailman.qos.ch/mailman/listinfo/slf4j-user" rel="noreferrer" target="_blank">http://mailman.qos.ch/mailman/<wbr>listinfo/slf4j-user</a></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Matt Sicker <<a href="mailto:boards@gmail.com" target="_blank">boards@gmail.com</a>></div>
</div>