You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bi...@apache.org on 2003/07/15 08:03:18 UTC

cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/loggers AccessLogInterceptor.java

billbarker    2003/07/14 23:03:18

  Modified:    src/share/org/apache/tomcat/modules/loggers
                        AccessLogInterceptor.java
  Log:
  Avoid binary output in the AccessLog.
  
  I can really see how much this is used ;-).  This should do what Costin originally intended (judging from the commit logs, I wasn't here that long ago :).  Also fix suppressing displaying the query-string when there isn't one.
  
  Revision  Changes    Path
  1.9       +7 -2      jakarta-tomcat/src/share/org/apache/tomcat/modules/loggers/AccessLogInterceptor.java
  
  Index: AccessLogInterceptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/loggers/AccessLogInterceptor.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- AccessLogInterceptor.java	4 Oct 2002 18:33:11 -0000	1.8
  +++ AccessLogInterceptor.java	15 Jul 2003 06:03:18 -0000	1.9
  @@ -231,7 +231,7 @@
   				fw.write(' ');
   				fw.write(request.requestURI().toString());
   				String q = request.queryString().toString();
  -				if (q != null) {
  +				if (q != null && q.length() > 0) {
   				    fw.write('?');
   				    fw.write(q);
   				}
  @@ -239,7 +239,12 @@
   				fw.write(request.protocol().toString().trim());
   				break;
   			    case 'b':
  -				fw.write(response.getContentLength());
  +				String cl = request.getHeader("Content-Length");
  +				if(cl != null) {
  +				    fw.write(cl);
  +				} else {
  +				    fw.write("-");
  +				}
   				break;
   			    case 's':
   				fw.write(Integer.
  
  
  

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