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