[slf4j-user] Bridging Log4J over SLF4J and the lack of Log4J Logger.setLevel()

Mark Petrovic mspetrovic at gmail.com
Thu Dec 27 01:15:37 CET 2012


Hi.  Thank you for SLF4J and Logback.

I have this line of code that just today came in from an upstream
dependency out of my control:

    private static final Logger logger = Logger.getLogger(FooImpl.class);
    static {
        logger.setLevel(Level.DEBUG);    <<<<<<<<<<<<<<<<
    }

Unfortunately, this is logging code I had been successfully bridging, but
this setLevel() call on a Log4J logger breaks it.

Do I have any elegant recourse beyond asking the developers of the line of
code to not do this?

Thanks.

-- 
Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20121226/b1d6e292/attachment.html>


More information about the slf4j-user mailing list