[logback-dev] svn commit: r687 - logback/trunk/logback-access/src/main/java/ch/qos/logback/access/tomcat

noreply.ceki at qos.ch noreply.ceki at qos.ch
Mon Oct 16 08:28:45 CEST 2006


Author: ceki
Date: Mon Oct 16 08:28:45 2006
New Revision: 687

Modified:
   logback/trunk/logback-access/src/main/java/ch/qos/logback/access/tomcat/LogbackValve.java

Log:


Modified: logback/trunk/logback-access/src/main/java/ch/qos/logback/access/tomcat/LogbackValve.java
==============================================================================
--- logback/trunk/logback-access/src/main/java/ch/qos/logback/access/tomcat/LogbackValve.java	(original)
+++ logback/trunk/logback-access/src/main/java/ch/qos/logback/access/tomcat/LogbackValve.java	Mon Oct 16 08:28:45 2006
@@ -18,6 +18,7 @@
 import ch.qos.logback.core.BasicStatusManager;
 import ch.qos.logback.core.Context;
 import ch.qos.logback.core.filter.Filter;
+import ch.qos.logback.core.joran.spi.JoranException;
 import ch.qos.logback.core.spi.AppenderAttachable;
 import ch.qos.logback.core.spi.AppenderAttachableImpl;
 import ch.qos.logback.core.spi.FilterAttachableImpl;
@@ -48,15 +49,15 @@
  * Here is a sample logback.xml file that can be used right away:
  * 
  * <pre>
- * &lt;configuration&gt; 
- *   &lt;appender name=&quot;STDOUT&quot; class=&quot;ch.qos.logback.core.ConsoleAppender&quot;&gt; 
- *     &lt;layout class=&quot;ch.qos.logback.access.PatternLayout&quot;&gt; 
- *       &lt;param name=&quot;Pattern&quot; value=&quot;%date %server %remoteIP %clientHost %user %requestURL &quot; /&gt;
- *     &lt;/layout&gt; 
- *   &lt;/appender&gt; 
- *             
- *   &lt;appender-ref ref=&quot;STDOUT&quot; /&gt; 
- * &lt;/configuration&gt;
+ *  &lt;configuration&gt; 
+ *    &lt;appender name=&quot;STDOUT&quot; class=&quot;ch.qos.logback.core.ConsoleAppender&quot;&gt; 
+ *      &lt;layout class=&quot;ch.qos.logback.access.PatternLayout&quot;&gt; 
+ *        &lt;param name=&quot;Pattern&quot; value=&quot;%date %server %remoteIP %clientHost %user %requestURL &quot; /&gt;
+ *      &lt;/layout&gt; 
+ *    &lt;/appender&gt; 
+ *              
+ *    &lt;appender-ref ref=&quot;STDOUT&quot; /&gt; 
+ *  &lt;/configuration&gt;
  * </pre>
  * 
  * A special, module-specific implementation of PatternLayout was implemented to
@@ -110,10 +111,13 @@
     }
     File configFile = new File(filename);
     if (configFile.exists()) {
-      JoranConfigurator jc = new JoranConfigurator();
-      jc.setContext(this);
-      jc.doConfigure(filename);
-      StatusPrinter.print(getStatusManager());
+      try {
+        JoranConfigurator jc = new JoranConfigurator();
+        jc.setContext(this);
+        jc.doConfigure(filename);
+      } catch (JoranException e) {
+        StatusPrinter.print(getStatusManager());
+      }
     } else {
       getStatusManager().add(
           new ErrorStatus("[" + filename + "] does not exist", this));



More information about the logback-dev mailing list