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

noreply.seb at qos.ch noreply.seb at qos.ch
Mon Oct 30 17:39:25 CET 2006


Author: seb
Date: Mon Oct 30 17:39:24 2006
New Revision: 817

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

Log:
filters now functionning in logback access, although the solution is not that elegant...

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 17:39:24 2006
@@ -32,12 +32,10 @@
     super.addInstanceRules(rs);
     
     rs.addRule(new Pattern("configuration"), new ConfigurationAction());
-    rs.addRule(new Pattern("configuration/appender-ref"), 
-        new AppenderRefAction());
+    rs.addRule(new Pattern("configuration/appender-ref"), new AppenderRefAction());
     
     rs.addRule(new Pattern("*/evaluator"), new EvaluatorAction());
-    rs.addRule(new Pattern("*/evaluator/matcher"),
-        new MatcherAction());
+    rs.addRule(new Pattern("*/evaluator/matcher"), new MatcherAction());
 
   }
 

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 17:39:24 2006
@@ -12,13 +12,13 @@
 
 
 
-import java.util.HashMap;
 import java.util.Map;
 
 import org.xml.sax.Attributes;
 
 import ch.qos.logback.core.CoreGlobal;
 import ch.qos.logback.core.boolex.EventEvaluator;
+import ch.qos.logback.core.filter.EvaluatorFilter;
 import ch.qos.logback.core.joran.spi.InterpretationContext;
 import ch.qos.logback.core.spi.LifeCycle;
 import ch.qos.logback.core.util.OptionHelper;
@@ -64,6 +64,12 @@
       if(isOfCorrectType(evaluator)) {
         evaluator.setContext(this.context);
         evaluator.setName(evaluatorName);
+        
+        if (ec.getObjectStack().size() > 0 && ec.peekObject() instanceof EvaluatorFilter) {
+          ((EvaluatorFilter)ec.peekObject()).setEvaluator(evaluator);
+        }
+        
+        
         ec.pushObject(evaluator);        
         addInfo("Adding evaluator named ["+evaluatorName+"] to the object stack");
       } else {
@@ -109,7 +115,7 @@
 
     if (o != evaluator) {
       addWarn(
-        "The object on the top the of the stack is not the layout pushed earlier.");
+        "The object on the top the of the stack is not the evaluator pushed earlier.");
     } else {
       ec.popObject();
 



More information about the logback-dev mailing list