tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kkoli...@apache.org
Subject svn commit: r1088460 - in /tomcat/trunk: java/org/apache/catalina/valves/AccessLogValve.java webapps/docs/changelog.xml
Date Mon, 04 Apr 2011 01:19:13 GMT
Author: kkolinko
Date: Mon Apr  4 01:19:13 2011
New Revision: 1088460

URL: http://svn.apache.org/viewvc?rev=1088460&view=rev
Log:
Implement display of multiple request headers in AccessLogValve:
print not just the value of the first header, but of the all of them,
separated by commas.

Modified:
    tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java?rev=1088460&r1=1088459&r2=1088460&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java Mon Apr  4 01:19:13 2011
@@ -28,6 +28,7 @@ import java.net.InetAddress;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Date;
+import java.util.Enumeration;
 import java.util.Iterator;
 import java.util.List;
 import java.util.TimeZone;
@@ -1241,12 +1242,15 @@ public class AccessLogValve extends Valv
         @Override
         public void addElement(StringBuilder buf, Date date, Request request,
                 Response response, long time) {
-            String value = request.getHeader(header);
-            if (value == null) {
-                buf.append('-');
-            } else {
-                buf.append(value);
+            Enumeration<String> iter = request.getHeaders(header);
+            if (iter.hasMoreElements()) {
+                buf.append(iter.nextElement());
+                while (iter.hasMoreElements()) {
+                    buf.append(',').append(iter.nextElement());
+                }
+                return;
             }
+            buf.append('-');
         }
     }
 

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1088460&r1=1088459&r2=1088460&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Mon Apr  4 01:19:13 2011
@@ -51,6 +51,11 @@
       <fix>
         Fix display of response headers in AccessLogValve. (kkolinko)
       </fix>
+      <update>
+        Implement display of multiple request headers in AccessLogValve:
+        print not just the value of the first header, but of the all of them,
+        separated by commas. (kkolinko)
+      </update>
     </changelog>
   </subsection>
   <subsection name="Web applications">



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message