[logback-dev] svn commit: r1116 - in logback/trunk/logback-access/src/main/java/ch/qos/logback/access: filter tomcat
noreply.seb at qos.ch
noreply.seb at qos.ch
Mon Dec 18 21:30:22 CET 2006
Author: seb
Date: Mon Dec 18 21:30:22 2006
New Revision: 1116
Removed:
logback/trunk/logback-access/src/main/java/ch/qos/logback/access/filter/mbeans-descriptors.xml
Modified:
logback/trunk/logback-access/src/main/java/ch/qos/logback/access/tomcat/LogbackValve.java
Log:
Fixed bug in LogbackValve: filter chain now called
Removed unnecessary mbeans-descriptors file.
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 Dec 18 21:30:22 2006
@@ -22,10 +22,12 @@
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.FilterAttachable;
import ch.qos.logback.core.spi.FilterAttachableImpl;
import ch.qos.logback.core.spi.FilterReply;
import ch.qos.logback.core.status.ErrorStatus;
import ch.qos.logback.core.status.StatusManager;
+import ch.qos.logback.core.status.WarnStatus;
import ch.qos.logback.core.util.StatusPrinter;
/**
@@ -76,7 +78,7 @@
* @author Sébastien Pennec
*/
public class LogbackValve extends ValveBase implements Context,
- AppenderAttachable {
+ AppenderAttachable, FilterAttachable {
public final static String DEFAULT_CONFIG_FILE = "conf" + File.separatorChar
+ "logback-access.xml";
@@ -121,7 +123,7 @@
}
} else {
getStatusManager().add(
- new ErrorStatus("[" + filename + "] does not exist", this));
+ new WarnStatus("[" + filename + "] does not exist", this));
}
started = true;
}
@@ -131,9 +133,13 @@
getNext().invoke(request, response);
- // System.out.println("**** LogbackValve invoke called");
TomcatServerAdapter adapter = new TomcatServerAdapter(request, response);
AccessEvent accessEvent = new AccessEvent(request, response, adapter);
+
+ if (getFilterChainDecision(accessEvent) == FilterReply.DENY) {
+ return;
+ }
+
// TODO better exception handling
aai.appendLoopOnAppenders(accessEvent);
}
More information about the logback-dev
mailing list