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

noreply.seb at qos.ch noreply.seb at qos.ch
Mon Dec 18 10:52:38 CET 2006


Author: seb
Date: Mon Dec 18 10:52:38 2006
New Revision: 1098

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/action/ConfigurationAction.java

Log:
Added debug mode and status printing to access module

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 Dec 18 10:52:38 2006
@@ -173,8 +173,6 @@
     } catch (JoranException e) {
       // errors have been registered as status messages
     }
-    
-    StatusPrinter.print(getStatusManager());
   }
 
   public void stop() {

Modified: logback/trunk/logback-access/src/main/java/ch/qos/logback/access/joran/action/ConfigurationAction.java
==============================================================================
--- logback/trunk/logback-access/src/main/java/ch/qos/logback/access/joran/action/ConfigurationAction.java	(original)
+++ logback/trunk/logback-access/src/main/java/ch/qos/logback/access/joran/action/ConfigurationAction.java	Mon Dec 18 10:52:38 2006
@@ -14,21 +14,35 @@
 
 import ch.qos.logback.core.joran.action.Action;
 import ch.qos.logback.core.joran.spi.InterpretationContext;
+import ch.qos.logback.core.util.StatusPrinter;
 
 
 
 public class ConfigurationAction extends Action {
   static final String INTERNAL_DEBUG_ATTR = "debug";
-  boolean attachment = false;
+  boolean debugMode = false;
 
   public void begin(InterpretationContext ec, String name, Attributes attributes) {
-    //String debugAttrib = attributes.getValue(INTERNAL_DEBUG_ATTR);
+    String debugAttrib = attributes.getValue(INTERNAL_DEBUG_ATTR);
+
+    if (
+      (debugAttrib == null) || debugAttrib.equals("")
+        || debugAttrib.equals("false") || debugAttrib.equals("null")) {
+      addInfo("Ignoring " + INTERNAL_DEBUG_ATTR + " attribute.");
+    } else { 
+      debugMode = true;
+    }
 
     // the context is appender attachable, so it is pushed on top of the stack
     ec.pushObject(getContext());
   }
 
   public void end(InterpretationContext ec, String name) {
+    if (debugMode) {
+      addInfo("End of configuration.");
+      StatusPrinter.print(context);
+    }
+    
     ec.popObject();
   }
 }



More information about the logback-dev mailing list