[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>
- * <configuration>
- * <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
- * <layout class="ch.qos.logback.access.PatternLayout">
- * <param name="Pattern" value="%date %server %remoteIP %clientHost %user %requestURL " />
- * </layout>
- * </appender>
- *
- * <appender-ref ref="STDOUT" />
- * </configuration>
+ * <configuration>
+ * <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ * <layout class="ch.qos.logback.access.PatternLayout">
+ * <param name="Pattern" value="%date %server %remoteIP %clientHost %user %requestURL " />
+ * </layout>
+ * </appender>
+ *
+ * <appender-ref ref="STDOUT" />
+ * </configuration>
* </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