You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by st...@apache.org on 2001/02/10 04:38:48 UTC

cvs commit: httpd-2.0/modules/loggers mod_log_config.c

stoddard    01/02/09 19:38:48

  Modified:    .        CHANGES
               docs/manual/mod mod_log_config.html
               modules/loggers mod_log_config.c
  Log:
  Add new LogFormat directive, %D, to log time it takes to serve a request
  in microseconds.
  
  Revision  Changes    Path
  1.84      +2 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.83
  retrieving revision 1.84
  diff -u -r1.83 -r1.84
  --- CHANGES	2001/02/10 00:33:36	1.83
  +++ CHANGES	2001/02/10 03:38:47	1.84
  @@ -1,4 +1,6 @@
   Changes with Apache 2.0b1
  +  *) Add new LogFormat directive, %D, to log time it takes to serve a
  +     request in microseconds. [Bill Stoddard]
   
     *) Change AddInputFilter and AddOutputFilter to SetInputFilter and
        SetOutputFilter.  This corresponds nicely with the other Set 
  
  
  
  1.46      +1 -0      httpd-2.0/docs/manual/mod/mod_log_config.html
  
  Index: mod_log_config.html
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/docs/manual/mod/mod_log_config.html,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- mod_log_config.html	2001/01/29 19:15:49	1.45
  +++ mod_log_config.html	2001/02/10 03:38:47	1.46
  @@ -137,6 +137,7 @@
                   '-' = connection will be closed after the response is sent.
   %...{Foobar}C:	The contents of cookie "Foobar" in the request sent to the
                   server.
  +%...D:          The time taken to serve the request, in microseconds.
   %...{FOOBAR}e:  The contents of the environment variable FOOBAR
   %...f:          Filename
   %...h:          Remote host
  
  
  
  1.47      +9 -0      httpd-2.0/modules/loggers/mod_log_config.c
  
  Index: mod_log_config.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/loggers/mod_log_config.c,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- mod_log_config.c	2001/02/08 07:44:05	1.46
  +++ mod_log_config.c	2001/02/10 03:38:48	1.47
  @@ -145,6 +145,7 @@
    * %...{format}t:  The time, in the form given by format, which should
    *                 be in strftime(3) format.
    * %...T:  the time taken to serve the request, in seconds.
  + * %...D:  the time taken to serve the request, in micro seconds.
    * %...u:  remote user (from auth; may be bogus if return status (%s) is 401)
    * %...U:  the URL path requested.
    * %...v:  the configured name of the server (i.e. which virtual host?)
  @@ -490,6 +491,11 @@
                                                / APR_USEC_PER_SEC);
   }
   
  +static const char *log_request_duration_microseconds(request_rec *r, char *a)
  +{
  +    return apr_psprintf(r->pool, "%ld", (apr_time_now() - r->request_time));
  +}
  +
   /* These next two routines use the canonical name:port so that log
    * parsers don't need to duplicate all the vhost parsing crud.
    */
  @@ -616,6 +622,9 @@
       },
       {
           'C', log_cookie, 0
  +    },
  +    {
  +        'D', log_request_duration_microseconds, 1
       },
       {
           '\0'