[logback-dev] svn commit: r1231 - logback/trunk/logback-access/src/main/java/ch/qos/logback/access/pattern

noreply.ceki at qos.ch noreply.ceki at qos.ch
Tue Jan 16 16:41:09 CET 2007


Author: ceki
Date: Tue Jan 16 16:41:09 2007
New Revision: 1231

Modified:
   logback/trunk/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestHeaderConverter.java

Log:
Let us default to ALL when no keys are specified

Modified: logback/trunk/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestHeaderConverter.java
==============================================================================
--- logback/trunk/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestHeaderConverter.java	(original)
+++ logback/trunk/logback-access/src/main/java/ch/qos/logback/access/pattern/RequestHeaderConverter.java	Tue Jan 16 16:41:09 2007
@@ -11,10 +11,10 @@
   public void start() {
     key = getFirstOption();
     if (OptionHelper.isEmpty(key)) {
-      addWarn("Missing key for the requested header");
-    } else {
-      super.start();
-    }
+      addWarn("Missing key for the requested header. Defaulting to all keys.");
+      key = null;
+    } 
+    super.start();
   }
 
   public String convert(AccessEvent accessEvent) {
@@ -22,7 +22,11 @@
       return "INACTIVE_HEADER_CONV";
     }
     
-    return accessEvent.getRequestHeader(key);
+    if(key != null) {
+      return accessEvent.getRequestHeader(key);
+    } else {
+      return accessEvent.getRequestHeaderMap().toString();
+    }
   }
 
 }



More information about the logback-dev mailing list