<div dir="ltr">Hi,<br><br>I previously used log4j with a JMSAppender sending messages to a specific ActiveMq Queue.<br>I managed to configure a FallBackErrorHandlor with a second JMSAppender in case the first JMSAppender was not able to write to the queue.<br>
The ErrorHandler was also configured to send emails when something went wrong.<br><br>I now want to try logback and wonder if there is a way to get errors returned by loggers at runtime.<br>Plesae consider the following situation :<br>
<br>**<br>&nbsp;* Hello world!<br>&nbsp;*<br>&nbsp;*/<br>public class App <br>{<br>&nbsp;&nbsp;&nbsp; public static void main( String[] args )<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ... (some code herer)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Logger log = LoggerFactory.getLogger(&quot;myLogger&quot;);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; log.debug(&quot;App : main&quot;);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println( &quot;Normal end of my process&quot; );<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br>Let&#39;s assume the &quot;myLogger&quot; is configured to use a JMSAppender.<br>
I want to know if the log.debug call failed and then not to display &quot;Normal end of my process.&quot;<br><br>1. Is this possible ? <br>2. How should I handle errors dealing with logback logger ?<br><br>Thank you<br>Regards,<br>
<br>Jonathan Dray<br><br><br><br></div>