tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r696234 - /tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java
Date Wed, 17 Sep 2008 10:56:38 GMT
Author: markt
Date: Wed Sep 17 03:56:37 2008
New Revision: 696234

URL: http://svn.apache.org/viewvc?rev=696234&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=45823
Log '-' rather than null when request headers are not present
Based on a patch by Per Landberg

Modified:
    tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java

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=696234&r1=696233&r2=696234&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java Wed Sep 17 03:56:37 2008
@@ -1238,7 +1238,12 @@
 
         public void addElement(StringBuffer buf, Date date, Request request,
                 Response response, long time) {
-            buf.append(request.getHeader(header));
+            String value = request.getHeader(header);
+            if (value == null) {
+                buf.append('-');
+            } else {
+                buf.append(value);
+            }
         }
     }
 



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


Mime
View raw message