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

noreply.seb at qos.ch noreply.seb at qos.ch
Tue Oct 10 21:33:53 CEST 2006


Author: seb
Date: Tue Oct 10 21:33:53 2006
New Revision: 659

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

Log:
added clf/common/combined keywords

Modified: logback/trunk/logback-access/src/main/java/ch/qos/logback/access/PatternLayout.java
==============================================================================
--- logback/trunk/logback-access/src/main/java/ch/qos/logback/access/PatternLayout.java	(original)
+++ logback/trunk/logback-access/src/main/java/ch/qos/logback/access/PatternLayout.java	Tue Oct 10 21:33:53 2006
@@ -215,6 +215,10 @@
   public static final Map<String, String> defaultConverterMap = new HashMap<String, String>();
 
   public static String CLF_PATTERN = "%h %l %u %t \"%r\" %s %b";
+  public static String CLF_PATTERN_NAME = "common";
+  public static String CLF_PATTERN_NAME_2 = "clf";
+  public static String COMBINED_PATTERN = "%h %l %u %t \"%r\" %>s %b \"%i{Referer}\" \"%i{User-Agent}";
+  public static String COMBINED_PATTERN_NAME = "combined";
 
   static {
 
@@ -316,4 +320,15 @@
     return doLayout((AccessEvent) o);
   }
 
+  @Override
+  public void start() {
+    if (getPattern().equalsIgnoreCase(CLF_PATTERN_NAME)
+        || getPattern().equalsIgnoreCase(CLF_PATTERN_NAME_2)) {
+      setPattern(CLF_PATTERN);
+    } else if (getPattern().equalsIgnoreCase(COMBINED_PATTERN_NAME)) {
+      setPattern(COMBINED_PATTERN);
+    }
+    super.start();
+  }
+
 }



More information about the logback-dev mailing list