[logback-user] org.slf4j.helpers.NOPLogger cannot be cast to ch.qos.logback.classic.Logger

BAKHTI Mohammed onlymed at hotmail.com
Thu Aug 25 15:21:15 CEST 2011



Hello, 

I got a problem when trying to deploy an application into Tomcat 

i got this exception : org.slf4j.helpers.NOPLogger cannot be cast to ch.qos.logback.classic.Logger


and the line in my code is : ch.qos.logback.classic.Logger applicationLogger = (Logger) org.slf4j.LoggerFactory.getLogger("my.logger.name");

any idea ?

Thanks 

> Date: Wed, 24 Aug 2011 18:00:25 +0200
> From: ceki at qos.ch
> To: logback-user at qos.ch
> Subject: Re: [logback-user] Exception and error safe logging
> 
> 
> Checking up on this, the AppenderBase and UnsynchronizedAppenderBase 
> classes catch all instances java.lang.Exception and derivatives but not 
> java.land.Error.
> 
> At present time, you would need to handle OutOfMemoryError on your own.
> 
> Sorry for the bs in my previous message.
> 
> On 24/08/2011 5:53 PM, Ceki Gülcü wrote:
> > On 24/08/2011 4:14 PM, Adam Fitzgerald wrote:
> >> Hello,
> >>
> >> For a project I'm working on we would like to be able to attempt
> >> recovery after the occurrence exceptions and some errors, and are
> >> investigating methods of integrating the use of logback into this
> >> strategy. In the case of exceptions, does logback make any guarantee
> >> about what will/won't be thrown from the message logging methods? Is
> >> there anything like a 'safe' logging API that will not throw?
> >
> > Logback will never throw exceptions visible at the application layer.
> >
> >> Secondly we want to catch OOM errors that may occur in a call to
> >> logback. The simplest (but tedious) approach would be to wrap the
> >> calls in a try-catch block. Alternatively we are considering proxying
> >> the logger and wrapping the calls to the real logger in a try catch
> >> within the proxy. Can anyone forsee any issues with doing this? Does
> >> any kind of functionality like this already exist?
> >
> > That includes OOM.
> >
> >> Thanks in advance,
> >> Adam
> 
> 
> -- 
> QOS.ch, main sponsor of cal10n, logback and slf4j open source projects, 
> is looking to hire talented software developers. For further details, 
> see http://logback.qos.ch/job.html
> _______________________________________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://qos.ch/mailman/listinfo/logback-user
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://qos.ch/pipermail/logback-user/attachments/20110825/d746c611/attachment.html>


More information about the Logback-user mailing list