incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r940448 - /sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/log/CustomLogFormat.java
Date Mon, 03 May 2010 13:26:39 GMT
Author: bdelacretaz
Date: Mon May  3 13:26:39 2010
New Revision: 940448

URL: http://svn.apache.org/viewvc?rev=940448&view=rev
Log:
SLING-1515 - Add support for logging request parameter values in CustomLogFormat

Modified:
    sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/log/CustomLogFormat.java

Modified: sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/log/CustomLogFormat.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/log/CustomLogFormat.java?rev=940448&r1=940447&r2=940448&view=diff
==============================================================================
--- sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/log/CustomLogFormat.java
(original)
+++ sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/log/CustomLogFormat.java
Mon May  3 13:26:39 2010
@@ -218,6 +218,10 @@ class CustomLogFormat {
                 param = new MethodParameter();
                 break;
 
+            case 'M':
+                param = new ParamParameter(name);
+                break;
+
             case 'o':
                 param = (name == null) ? null : new HeaderParameter(name, false);
                 break;
@@ -417,6 +421,10 @@ class CustomLogFormat {
             return this.parName;
         }
 
+        protected String getParParam() {
+            return this.parParam;
+        }
+
         public String toString() {
             StringBuffer result = new StringBuffer("%");
 
@@ -535,6 +543,20 @@ class CustomLogFormat {
         }
     }
 
+    static class ParamParameter extends BaseParameter {
+        public ParamParameter(String parParam) {
+            super('M', parParam, true);
+        }
+
+        protected String getValue(SlingHttpServletRequest request) {
+            return request.getParameter(this.getParParam());
+        }
+
+        protected String getValue(SlingHttpServletResponseImpl response) {
+            return null;
+        }
+    }
+
     static class IdParameter extends BaseParameter {
         public IdParameter() {
             super('R', null, false);



Mime
View raw message