[logback-dev] what replaced StaticLoggerBinder to invoke ContextSelectorStaticBinder.init()?

logback developers list logback-dev at qos.ch
Fri Jun 9 19:27:37 CEST 2023


Yeah my issue is that I have a unit test that checks if ContextSelectorStaticBinder is properly configured to return our custom ContextSelector and I'm not sure what to replace that with.

        ContextSelector selector = ContextSelectorStaticBinder.getSingleton().getContextSelector();
        assertTrue(selector instanceof FrameworkLoggerContextSelector);

getContextSelector() now returns null in my unit test.

BR,

Richard
On 6/9/2023 1:07:26 PM, logback developers list via logback-dev <logback-dev at qos.ch> wrote:

Hello Richard,

StaticLoggerBinder has been replaced by
org.slf4j.spi.SLF4JServiceProvider of which LogbackServiceProvider is an
implementation.

SLF4JServiceProvider interface has a method called initialize().

Is this what you were asking?

--
Ceki Gülcü

Sponsoring SLF4J/logback/reload4j at https://github.com/sponsors/qos-ch

On 6/9/2023 7:01 PM, logback developers list via logback-dev wrote:
> Before 1.3, the class StaticLoggerBinder had an init method that would
> in turn call the init method on the singleton ContextSelectorBinder:
>
> contextSelectorBinder.init(defaultLoggerContext, KEY);
>
> -Richard
> 48c29399-04ec-4cd1-8794-c7507a7d5ded
_______________________________________________
logback-dev mailing list
logback-dev at qos.ch
https://mailman.qos.ch/cgi-bin/mailman/listinfo/logback-dev
[17fa5a94-06c8-464e-bde9-1843e17d88e4]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-dev/attachments/20230609/f2f82ec7/attachment-0001.htm>


More information about the logback-dev mailing list