[logback-user] Programmatic configuration

Kristoffer Sjögren stoffe at gmail.com
Wed Sep 4 08:29:02 CEST 2013


Hi

I would like to handle logback configuration programmatically - without
files (XML, Groovy, etc).

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).

It would be nice to if BasicConfigurator could be replaced for something
else, maybe using
http://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html or
something similar.

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.

Cheers,
-Kristoffer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20130904/c55c9305/attachment.html>


More information about the Logback-user mailing list