[logback-dev] svn commit: r1513 - logback/trunk/logback-examples/src/main/java/chapter3

noreply.ceki at qos.ch noreply.ceki at qos.ch
Thu May 3 16:41:08 CEST 2007


Author: ceki
Date: Thu May  3 16:41:08 2007
New Revision: 1513

Modified:
   logback/trunk/logback-examples/src/main/java/chapter3/MyApp2.java

Log:
better error reporting

Modified: logback/trunk/logback-examples/src/main/java/chapter3/MyApp2.java
==============================================================================
--- logback/trunk/logback-examples/src/main/java/chapter3/MyApp2.java	(original)
+++ logback/trunk/logback-examples/src/main/java/chapter3/MyApp2.java	Thu May  3 16:41:08 2007
@@ -16,6 +16,7 @@
 import ch.qos.logback.classic.LoggerContext;
 import ch.qos.logback.classic.joran.JoranConfigurator;
 import ch.qos.logback.core.joran.spi.JoranException;
+import ch.qos.logback.core.util.StatusPrinter;
 
 public class MyApp2 {
   final static Logger logger = LoggerFactory.getLogger(MyApp2.class);
@@ -23,13 +24,14 @@
   public static void main(String[] args) {
     LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
     
+
     try {
       JoranConfigurator configurator = new JoranConfigurator();
       configurator.setContext(lc);
       lc.shutdownAndReset();
       configurator.doConfigure(args[0]);
     } catch (JoranException je) {
-      je.printStackTrace();
+      StatusPrinter.print(lc);
     }
 
     logger.info("Entering application.");



More information about the logback-dev mailing list