<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
<br>Hello, <br><br>I got a problem when trying to deploy an application into Tomcat <br><br>i got this exception : org.slf4j.helpers.NOPLogger cannot be cast to ch.qos.logback.classic.Logger<br><br><br>and the line in my code is : ch.qos.logback.classic.Logger applicationLogger = (Logger) org.slf4j.LoggerFactory.getLogger("my.logger.name");<br><br>any idea ?<br><br>Thanks <br><br><div>> Date: Wed, 24 Aug 2011 18:00:25 +0200<br>> From: ceki@qos.ch<br>> To: logback-user@qos.ch<br>> Subject: Re: [logback-user] Exception and error safe logging<br>> <br>> <br>> Checking up on this, the AppenderBase and UnsynchronizedAppenderBase <br>> classes catch all instances java.lang.Exception and derivatives but not <br>> java.land.Error.<br>> <br>> At present time, you would need to handle OutOfMemoryError on your own.<br>> <br>> Sorry for the bs in my previous message.<br>> <br>> On 24/08/2011 5:53 PM, Ceki Gülcü wrote:<br>> > On 24/08/2011 4:14 PM, Adam Fitzgerald wrote:<br>> >> Hello,<br>> >><br>> >> For a project I'm working on we would like to be able to attempt<br>> >> recovery after the occurrence exceptions and some errors, and are<br>> >> investigating methods of integrating the use of logback into this<br>> >> strategy. In the case of exceptions, does logback make any guarantee<br>> >> about what will/won't be thrown from the message logging methods? Is<br>> >> there anything like a 'safe' logging API that will not throw?<br>> ><br>> > Logback will never throw exceptions visible at the application layer.<br>> ><br>> >> Secondly we want to catch OOM errors that may occur in a call to<br>> >> logback. The simplest (but tedious) approach would be to wrap the<br>> >> calls in a try-catch block. Alternatively we are considering proxying<br>> >> the logger and wrapping the calls to the real logger in a try catch<br>> >> within the proxy. Can anyone forsee any issues with doing this? Does<br>> >> any kind of functionality like this already exist?<br>> ><br>> > That includes OOM.<br>> ><br>> >> Thanks in advance,<br>> >> Adam<br>> <br>> <br>> -- <br>> QOS.ch, main sponsor of cal10n, logback and slf4j open source projects, <br>> is looking to hire talented software developers. For further details, <br>> see http://logback.qos.ch/job.html<br>> _______________________________________________<br>> Logback-user mailing list<br>> Logback-user@qos.ch<br>> http://qos.ch/mailman/listinfo/logback-user<br></div> </div></body>
</html>