[logback-dev] svn commit: r815 - in logback/trunk: logback-access/src/main/java/ch/qos/logback/access/jetty logback-access/src/main/java/ch/qos/logback/access/joran logback-access/src/main/java/ch/qos/logback/access/spi logback-core/src/main/java/ch/qos/logback/core/joran/action

noreply.seb at qos.ch noreply.seb at qos.ch
Mon Oct 30 15:51:18 CET 2006


Author: seb
Date: Mon Oct 30 15:51:18 2006
New Revision: 815

Modified:
   logback/trunk/logback-access/src/main/java/ch/qos/logback/access/jetty/RequestLogImpl.java
   logback/trunk/logback-access/src/main/java/ch/qos/logback/access/joran/JoranConfigurator.java
   logback/trunk/logback-access/src/main/java/ch/qos/logback/access/spi/AccessEvent.java
   logback/trunk/logback-core/src/main/java/ch/qos/logback/core/joran/action/AbstractEventEvaluatorAction.java

Log:
Work in progress.
Access now knows about Evaluators. Working on Filters

Modified: logback/trunk/logback-access/src/main/java/ch/qos/logback/access/jetty/RequestLogImpl.java
==============================================================================
--- logback/trunk/logback-access/src/main/java/ch/qos/logback/access/jetty/RequestLogImpl.java	(original)
+++ logback/trunk/logback-access/src/main/java/ch/qos/logback/access/jetty/RequestLogImpl.java	Mon Oct 30 15:51:18 2006
@@ -1,6 +1,7 @@
 package ch.qos.logback.access.jetty;
 
 import java.io.File;
+import java.util.HashMap;
 import java.util.Iterator;
 
 import org.mortbay.jetty.Request;
@@ -11,6 +12,7 @@
 import ch.qos.logback.access.spi.AccessEvent;
 import ch.qos.logback.core.Appender;
 import ch.qos.logback.core.ContextBase;
+import ch.qos.logback.core.CoreGlobal;
 import ch.qos.logback.core.spi.AppenderAttachable;
 import ch.qos.logback.core.spi.AppenderAttachableImpl;
 import ch.qos.logback.core.status.ErrorStatus;
@@ -108,6 +110,11 @@
   AppenderAttachableImpl aai = new AppenderAttachableImpl();
   String filename;
 
+  public RequestLogImpl() {
+    putObject(CoreGlobal.EVALUATOR_MAP, new HashMap());
+  }
+  
+  
   public void log(Request jettyRequest, Response jettyResponse) {
     JettyServerAdapter adapter = new JettyServerAdapter(jettyRequest,
         jettyResponse);

Modified: logback/trunk/logback-access/src/main/java/ch/qos/logback/access/joran/JoranConfigurator.java
==============================================================================
--- logback/trunk/logback-access/src/main/java/ch/qos/logback/access/joran/JoranConfigurator.java	(original)
+++ logback/trunk/logback-access/src/main/java/ch/qos/logback/access/joran/JoranConfigurator.java	Mon Oct 30 15:51:18 2006
@@ -12,8 +12,10 @@
 
 
 import ch.qos.logback.access.joran.action.ConfigurationAction;
+import ch.qos.logback.access.joran.action.EvaluatorAction;
 import ch.qos.logback.core.joran.JoranConfiguratorBase;
 import ch.qos.logback.core.joran.action.AppenderRefAction;
+import ch.qos.logback.core.joran.action.MatcherAction;
 import ch.qos.logback.core.joran.spi.Pattern;
 import ch.qos.logback.core.joran.spi.RuleStore;
 
@@ -32,6 +34,10 @@
     rs.addRule(new Pattern("configuration"), new ConfigurationAction());
     rs.addRule(new Pattern("configuration/appender-ref"), 
         new AppenderRefAction());
+    
+    rs.addRule(new Pattern("*/evaluator"), new EvaluatorAction());
+    rs.addRule(new Pattern("*/evaluator/matcher"),
+        new MatcherAction());
 
   }
 

Modified: logback/trunk/logback-access/src/main/java/ch/qos/logback/access/spi/AccessEvent.java
==============================================================================
--- logback/trunk/logback-access/src/main/java/ch/qos/logback/access/spi/AccessEvent.java	(original)
+++ logback/trunk/logback-access/src/main/java/ch/qos/logback/access/spi/AccessEvent.java	Mon Oct 30 15:51:18 2006
@@ -62,6 +62,14 @@
     this.timeStamp = System.currentTimeMillis();
     this.serverAdapter = adapter;
   }
+  
+  public HttpServletRequest getRequest() {
+    return httpRequest;
+  }
+  
+  public HttpServletResponse getResponse() {
+    return httpResponse;
+  }
 
   public long getTimeStamp() {
     return timeStamp;

Modified: logback/trunk/logback-core/src/main/java/ch/qos/logback/core/joran/action/AbstractEventEvaluatorAction.java
==============================================================================
--- logback/trunk/logback-core/src/main/java/ch/qos/logback/core/joran/action/AbstractEventEvaluatorAction.java	(original)
+++ logback/trunk/logback-core/src/main/java/ch/qos/logback/core/joran/action/AbstractEventEvaluatorAction.java	Mon Oct 30 15:51:18 2006
@@ -12,6 +12,7 @@
 
 
 
+import java.util.HashMap;
 import java.util.Map;
 
 import org.xml.sax.Attributes;
@@ -64,7 +65,7 @@
         evaluator.setContext(this.context);
         evaluator.setName(evaluatorName);
         ec.pushObject(evaluator);        
-        addInfo("Adding evaluator named ["+evaluatorName+"] to the map of evaluators");
+        addInfo("Adding evaluator named ["+evaluatorName+"] to the object stack");
       } else {
         inError = true;
         addError("Evaluator of type ["+className+"] is not of the desired type");



More information about the logback-dev mailing list