jakarta-slide-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pne...@apache.org
Subject cvs commit: jakarta-slide/src/webdav/server/org/apache/slide/webdav/filter LogFilter.java
Date Fri, 17 Jan 2003 15:28:53 GMT
pnever      2003/01/17 07:28:53

  Modified:    src/conf/webapp web.xml
               src/webdav/server/org/apache/slide/webdav/filter
                        LogFilter.java
  Log:
  Extended log formatting: added %x for the value of the content-length req header.
  
  Revision  Changes    Path
  1.20      +2 -2      jakarta-slide/src/conf/webapp/web.xml
  
  Index: web.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/conf/webapp/web.xml,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- web.xml	18 Dec 2002 16:03:24 -0000	1.19
  +++ web.xml	17 Jan 2003 15:28:52 -0000	1.20
  @@ -7,8 +7,8 @@
           <filter-class>org.apache.slide.webdav.filter.LogFilter</filter-class>
           <init-param>
               <param-name>logFormat</param-name>
  -            <param-value>%t, %p, %m, %s "%l", %i, %u</param-value>
  -            <description>Defines the format of a log line. The following placeholders
are available: %t=thread-name, %p=principal-name, %m=method-name, %s=status-code, %l=default-status-text,
%k=detailed-status-text, %i=elapsed-time, %u=relative-request-uri, %v=request-uri.</description>
  +            <param-value>%t, %p, %m, %s "%l", %x, %i, %u</param-value>
  +            <description>Defines the format of a log line. The following placeholders
are available: %t=thread-name, %p=principal-name, %m=method-name, %s=status-code, %l=default-status-text,
%k=detailed-status-text, %i=elapsed-time, %u=relative-request-uri, %v=request-uri, %x=request-content-length.</description>
           </init-param>
           <init-param>
               <param-name>outputToConsole</param-name>
  
  
  
  1.2       +9 -4      jakarta-slide/src/webdav/server/org/apache/slide/webdav/filter/LogFilter.java
  
  Index: LogFilter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/filter/LogFilter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LogFilter.java	18 Dec 2002 16:04:37 -0000	1.1
  +++ LogFilter.java	17 Jan 2003 15:28:53 -0000	1.2
  @@ -180,6 +180,9 @@
           String detail = resp.getStatusText();
           if( detail == null || "".equals(detail) )
               detail = message;
  +        String reqCl = req.getHeader( "Content-Length" );
  +        if( reqCl == null )
  +            reqCl = "-";
           
           StringBuffer b = new StringBuffer( logFormat );
           int i;
  @@ -201,6 +204,8 @@
           if( i >= 0 ) b.replace( i, i+2, path );
           i = b.toString().indexOf("%v");
           if( i >= 0 ) b.replace( i, i+2, uri );
  +        i = b.toString().indexOf("%x");
  +        if( i >= 0 ) b.replace( i, i+2, reqCl );
           
           if( outputToConsole )
               System.out.println( b.toString() );
  
  
  

--
To unsubscribe, e-mail:   <mailto:slide-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:slide-dev-help@jakarta.apache.org>


Mime
View raw message