[slf4j-user] Should NOPLogger implement org.slf4j.spi.LocationAwareLogger? Dealing with appender startup problem

Ceki Gulcu ceki at qos.ch
Mon Feb 22 07:45:05 CET 2010


Hello Seth,


Reading the code of the Category class in log4j-over-slf4j, it appears
that both loggers of type org.slf4j.Logger *and* LocationAwareLogger
are supported. Category class in log4j-over-slf4j should throw an
exception if the slf4j logger it gets is of type NOPLogger. Can you
show the exception you are observing?

Cheers,

On 22.02.2010 01:57, ownedthx wrote:
>
> Hi all,
>
> I'm using a logback appender which logs during startup, causing a NOPLogger
> to be created while the underlying library initializes.
>
> In this specific scenario, I'm coercing a 3rd-party library out of direct
> log4j usage by using the log4j-over-slf4j bridge.  However, the
> Category.java implementation in the bridge will throw an exception if the
> underlying logger (in this case, NOPLogger) does not implement the
> LocationAwareLogger interface.
>
> This seems wrong to me--seems to me the NOPLogger should implement
> LocationAwareLogger, and NOP the log statement specific to that, just like
> it does with all the other various log overloads it implements, instead of
> causing the appender to fail to start.
>
> Any thoughts on this?
>
> By the way, I did stop the error by doing just what was recommended here...
>
> Thanks,
> Seth
>
>



More information about the slf4j-user mailing list