httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stodd...@locus.apache.org
Subject cvs commit: apache-2.0/src/modules/standard mod_log_config.c
Date Fri, 03 Nov 2000 03:00:57 GMT
stoddard    00/11/02 19:00:57

  Modified:    src      CHANGES
               src/modules/standard mod_log_config.c
  Log:
  Merge forward mod_log_config enhancement.
  
  Added three log methods: CLF compliant '-' byte count, method and protocol.
  
  CVg:   then name the system in this line, otherwise delete it.
  
  Revision  Changes    Path
  1.304     +4 -0      apache-2.0/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/CHANGES,v
  retrieving revision 1.303
  retrieving revision 1.304
  diff -u -r1.303 -r1.304
  --- CHANGES	2000/11/03 01:31:34	1.303
  +++ CHANGES	2000/11/03 03:00:57	1.304
  @@ -1,5 +1,9 @@
   Changes with Apache 2.0a8
   
  +  *) Port three log methods from mod_log_config 1.3 to 2.0: 
  +     CLF compliant '-' byte count, method and protocol.
  +     [Bill Stoddard]
  +
     *) Add a new LogFormat directive, %c, that will log connection
        status at the end of the response as follows:
        'X' - connection aborted before the response completed.
  
  
  
  1.38      +37 -3     apache-2.0/src/modules/standard/mod_log_config.c
  
  Index: mod_log_config.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_log_config.c,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- mod_log_config.c	2000/11/03 01:31:37	1.37
  +++ mod_log_config.c	2000/11/03 03:00:57	1.38
  @@ -118,7 +118,9 @@
    * literal characters copied into the log files, and '%' directives as
    * follows:
    *
  - * %...b:  bytes sent, excluding HTTP headers.
  + * %...B:  bytes sent, excluding HTTP headers.
  + * %...b:  bytes sent, excluding HTTP headers in CLF format, i.e. a '-'
  + *         when no bytes where sent (rather than a '0'.
    * %...c:  Status of the connection.
    *         'X' = connection aborted before the response completed.
    *         '+' = connection may be kept alive after the response is sent.
  @@ -146,6 +148,8 @@
    * %...U:  the URL path requested.
    * %...v:  the configured name of the server (i.e. which virtual host?)
    * %...V:  the server name according to the UseCanonicalName setting
  + * %...m:  the request method
  + * %...h:  the request protocol
    *
    * The '...' can be nothing at all (e.g. "%h %u %r %s %b"), or it can
    * indicate conditions for inclusion of the item (which will cause it
  @@ -345,12 +349,20 @@
   {
       return r->uri;
   }
  +static const char *log_request_method(request_rec *r, char *a)
  +{
  +    return r->method;
  +}
  +static const char *log_request_protocol(request_rec *r, char *a)
  +{
  +    return r->protocol;
  +}
   static const char *log_status(request_rec *r, char *a)
   {
       return pfmt(r->pool, r->status);
   }
   
  -static const char *log_bytes_sent(request_rec *r, char *a)
  +static const char *clf_log_bytes_sent(request_rec *r, char *a)
   {
       if (!r->sent_bodyct) {
           return "-";
  @@ -362,6 +374,19 @@
       }
   }
   
  +static const char *log_bytes_sent(request_rec *r, char *a)
  +{
  +    if (!r->sent_bodyct) {
  +        return "0";
  +    }
  +    else {
  +        long int bs;
  +        ap_bgetopt(r->connection->client, BO_BYTECT, &bs);
  +	return apr_psprintf(r->pool, "%ld", bs);
  +    }
  +}
  +
  +
   static const char *log_header_in(request_rec *r, char *a)
   {
       return apr_table_get(r->headers_in, a);
  @@ -524,9 +549,12 @@
           's', log_status, 1
       },
       {
  -        'b', log_bytes_sent, 0
  +        'b', clf_log_bytes_sent, 0
       },
       {
  +        'B', log_bytes_sent, 0
  +    },
  +    {
           'i', log_header_in, 0
       },
       {
  @@ -549,6 +577,12 @@
       },
       {
           'P', log_child_pid, 0
  +    },
  +    {
  +        'H', log_request_protocol, 0
  +    },
  +    {
  +        'm', log_request_method, 0
       },
       {
           'c', log_connection_status, 0
  
  
  

Mime
View raw message