<div dir="ltr">Or better yet, extract <span style="font-family:arial,sans-serif;font-size:13px">ContextInitializer.autoConfig to an SPI interface that will fallback to </span><span style="font-family:arial,sans-serif;font-size:13px">ContextInitializer if no provider is found on classpath. Maybe even have a system property that force a specific implementation, if multiple ones are found.</span><div>
<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Sep 4, 2013 at 8:29 AM, Kristoffer Sjögren <span dir="ltr"><<a href="mailto:stoffe@gmail.com" target="_blank">stoffe@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13.333333969116211px">Hi</span><div style="font-family:arial,sans-serif;font-size:13.333333969116211px">
<br></div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px">
I would like to handle logback configuration programmatically - without files (XML, Groovy, etc).</div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px"><br></div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px">
My problem is that I cant find an obvious way to override the fallback behavior in ContextInitializer.autoConfig, which ultimately result that a ConsoleAppender is created by BasicConfigurator (since no URL was found for Joran).</div>
<div style="font-family:arial,sans-serif;font-size:13.333333969116211px"><br></div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px">It would be nice to if BasicConfigurator could be replaced for something else, maybe using <a href="http://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html" target="_blank">http://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html</a> or something similar.</div>
<div style="font-family:arial,sans-serif;font-size:13.333333969116211px"><br></div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px">Maybe adding an modified copy of BasicConfigurator (but with same fully qualified classname) first on classpath would be possible? But this feels more like a hack.</div>
<div style="font-family:arial,sans-serif;font-size:13.333333969116211px"><br></div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px">Cheers,</div><div style="font-family:arial,sans-serif;font-size:13.333333969116211px">
-Kristoffer</div></div>
</blockquote></div><br></div>