Based on way too much trench work in the initialization of log4j, I'd say
the easiest way to ensure custom initialization is to set up before you do
any logging. In complicated scenarios, you can always reconfigure after the
fact. Spring Boot, for example, sets up a filter to ignore all log messages
until it initializes properly.

On Thu, Apr 20, 2017 at 05:05, Christian Schneider <ch...@die-schneider.net>
wrote:

> Logging in java always reminds me of this comic strip:
> https://xkcd.com/927/
>
>
> Christian
>
>
> On 20.04.2017 14:03, Christian Schneider wrote:
>
> So to fight the multiple logging frameworks problem we add another one ....
>
> I understand, that the logging initialization with a static factory is a
> bad pattern in OSGi ... but as we have so much code out there that already
> uses this I think we could as well just leave the situation like it is now.
> Pax-logging for example is not really nice code when it comes to providing
> the bridge to existing logging frameworks but as we will still need it for
> lots of libraries we will not get rid of it anyway.
>
> Christian
>
> On 20.04.2017 12:44, Cristiano Gavião wrote:
>
> If you read the proposed spec, they won't tie to SLF4J. OSGi will have an
> own set of classes (as already they have) with methods and factories
> *based* on the style existent in SLF4J and will not use slf4j-api.
>
> The https://github.com/osgi/slf4j-osgi is aimed to be just a binding
> implementation for those projects that uses slf4j's static binding, but it
> will redirect all log entries to new osgi services...  you can build you
> own too :)
>
> I'm one of those that would use DS-managed Loggers for new projects when
> creating service classes... but I'll still use the static logger for
> non-service classes.
>
>
> --
> Christian Schneiderhttp://www.liquid-reality.de
>
> Open Source Architecthttp://www.talend.com
>
>
>
> --
> Christian Schneiderhttp://www.liquid-reality.de
>
> Open Source Architecthttp://www.talend.com
>
> _______________________________________________
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org
> https://mail.osgi.org/mailman/listinfo/osgi-dev

-- 
Matt Sicker <boa...@gmail.com>
_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to