httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject cvs commit: httpd-2.0/modules/loggers mod_log_config.c
Date Wed, 14 May 2003 03:20:51 GMT
trawick     2003/05/13 20:20:51

  Modified:    .        Tag: APACHE_2_0_BRANCH CHANGES STATUS
               docs/manual/mod Tag: APACHE_2_0_BRANCH
                        mod_log_config.html.en mod_log_config.xml
               modules/loggers Tag: APACHE_2_0_BRANCH mod_log_config.c
  Log:
  merge this feature into 2.0.46-dev:
  
       mod_log_config: Add the ability to log the id of the thread
       processing the request via new %P formats.
  
  Reviewed by:    stoddard, nd
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.988.2.96 +3 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.988.2.95
  retrieving revision 1.988.2.96
  diff -u -r1.988.2.95 -r1.988.2.96
  --- CHANGES	13 May 2003 23:28:52 -0000	1.988.2.95
  +++ CHANGES	14 May 2003 03:20:49 -0000	1.988.2.96
  @@ -1,5 +1,8 @@
   Changes with Apache 2.0.46
   
  +  *) mod_log_config: Add the ability to log the id of the thread 
  +     processing the request via new %P formats.  [Jeff Trawick]
  +
     *) Use appropriate language code for Czech (cs) and Traditional Chinese
        (zh-tw) in default config files. PR 9427.  [André Malo]
   
  
  
  
  1.751.2.269 +1 -8      httpd-2.0/STATUS
  
  Index: STATUS
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/STATUS,v
  retrieving revision 1.751.2.268
  retrieving revision 1.751.2.269
  diff -u -r1.751.2.268 -r1.751.2.269
  --- STATUS	13 May 2003 23:45:30 -0000	1.751.2.268
  +++ STATUS	14 May 2003 03:20:49 -0000	1.751.2.269
  @@ -220,13 +220,6 @@
                 An appropriate change-log entry should warn the rest of the
                 people, shouldn't it?
   
  -    * mod_log_config: be able to log the id of the thread that handled
  -      the request
  -      modules/loggers/mod_log_config.c: r1.102-1.104
  -      docs/manual/mod/mod_log_config.xml.diff?r1=1.19&r2=1.22
  -      +1: trawick, stoddard, nd
  -      (the comment on top of the file still talks about %I; should be fixed :)
  -
       * ap_get_mime_headers_core: allocate space for the trailing null
         when folding is in effect.
         PR 18170 [Peter Mayne <PeterMayne@SPAM_SUX.ap.spherion.com>]
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.20.2.7  +18 -13    httpd-2.0/docs/manual/mod/mod_log_config.html.en
  
  Index: mod_log_config.html.en
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/docs/manual/mod/mod_log_config.html.en,v
  retrieving revision 1.20.2.6
  retrieving revision 1.20.2.7
  diff -u -r1.20.2.6 -r1.20.2.7
  --- mod_log_config.html.en	14 Apr 2003 18:44:36 -0000	1.20.2.6
  +++ mod_log_config.html.en	14 May 2003 03:20:50 -0000	1.20.2.7
  @@ -114,34 +114,39 @@
           <td>The canonical port of the server serving the request</td></tr>
   <tr class="odd"><td><code>%...P</code></td>
           <td>The process ID of the child that serviced the request.</td></tr>
  -<tr><td><code>%...q</code></td>
  +<tr><td><code>%...{<var>format</var>}P</code></td>
  +        <td>The process ID or thread id of the child that serviced the 
  +        request.  Valid formats are <code>pid</code> and <code>tid</code>.
  +        (<em>Apache 2.0.46 and later</em>)
  +        </td></tr>
  +<tr class="odd"><td><code>%...q</code></td>
           <td>The query string (prepended with a <code>?</code> if a query
           string exists, otherwise an empty string)</td></tr>
  -<tr class="odd"><td><code>%...r</code></td>
  +<tr><td><code>%...r</code></td>
           <td>First line of request</td></tr>
  -<tr><td><code>%...s</code></td>
  +<tr class="odd"><td><code>%...s</code></td>
           <td>Status. For requests that got internally redirected, this is
           the status of the *original* request --- <code>%...&gt;s</code>
           for the last.</td></tr>
  -<tr class="odd"><td><code>%...t</code></td>
  +<tr><td><code>%...t</code></td>
           <td>Time, in common log format time format (standard english
           format)</td></tr>
  -<tr><td><code>%...{<var>format</var>}t</code></td>
  +<tr class="odd"><td><code>%...{<var>format</var>}t</code></td>
           <td>The time, in the form given by format, which should be in
           <code>strftime(3)</code> format. (potentially localized)</td></tr>
  -<tr class="odd"><td><code>%...T</code></td>
  +<tr><td><code>%...T</code></td>
           <td>The time taken to serve the request, in seconds.</td></tr>
  -<tr><td><code>%...u</code></td>
  +<tr class="odd"><td><code>%...u</code></td>
           <td>Remote user (from auth; may be bogus if return status
           (<code>%s</code>) is 401)</td></tr>
  -<tr class="odd"><td><code>%...U</code></td>
  +<tr><td><code>%...U</code></td>
           <td>The URL path requested, not including any query string.</td></tr>
  -<tr><td><code>%...v</code></td>
  +<tr class="odd"><td><code>%...v</code></td>
           <td>The canonical <code class="directive"><a href="../mod/core.html#servername">ServerName</a></code>
           of the server serving the request.</td></tr>
  -<tr class="odd"><td><code>%...V</code></td>
  +<tr><td><code>%...V</code></td>
           <td>The server name according to the <code class="directive"><a
href="../mod/core.html#usecanonicalname">UseCanonicalName</a></code> setting.</td></tr>
  -<tr><td><code>%...X</code></td>
  +<tr class="odd"><td><code>%...X</code></td>
           <td>Connection status when response is completed:
   
           <table>
  @@ -158,10 +163,10 @@
           <p>(This directive was <code>%...c</code> in late versions of
Apache
           1.3, but this conflicted with the historical ssl
           <code>%...{<var>var</var>}c</code> syntax.)</p></td></tr>
  -<tr class="odd"><td><code>%...I</code></td>
  +<tr><td><code>%...I</code></td>
           <td>Bytes received, including request and headers, cannot be zero.
           You need to enable <code class="module"><a href="../mod/mod_logio.html">mod_logio</a></code>
to use this.</td></tr>
  -<tr><td><code>%...O</code></td>
  +<tr class="odd"><td><code>%...O</code></td>
           <td>Bytes sent, including headers, cannot be zero. You need to
           enable <code class="module"><a href="../mod/mod_logio.html">mod_logio</a></code>
to use this.</td></tr>
   </table>
  
  
  
  1.13.2.6  +6 -0      httpd-2.0/docs/manual/mod/mod_log_config.xml
  
  Index: mod_log_config.xml
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/docs/manual/mod/mod_log_config.xml,v
  retrieving revision 1.13.2.5
  retrieving revision 1.13.2.6
  diff -u -r1.13.2.5 -r1.13.2.6
  --- mod_log_config.xml	15 Apr 2003 22:56:38 -0000	1.13.2.5
  +++ mod_log_config.xml	14 May 2003 03:20:50 -0000	1.13.2.6
  @@ -107,6 +107,12 @@
       <tr><td><code>%...P</code></td>
           <td>The process ID of the child that serviced the request.</td></tr>
   
  +    <tr><td><code>%...{<var>format</var>}P</code></td>
  +        <td>The process ID or thread id of the child that serviced the 
  +        request.  Valid formats are <code>pid</code> and <code>tid</code>.
  +        (<em>Apache 2.0.46 and later</em>)
  +        </td></tr>
  +
       <tr><td><code>%...q</code></td>
           <td>The query string (prepended with a <code>?</code> if a query
           string exists, otherwise an empty string)</td></tr>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.95.2.6  +17 -3     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.95.2.5
  retrieving revision 1.95.2.6
  diff -u -r1.95.2.5 -r1.95.2.6
  --- mod_log_config.c	4 Apr 2003 01:07:33 -0000	1.95.2.5
  +++ mod_log_config.c	14 May 2003 03:20:50 -0000	1.95.2.6
  @@ -134,6 +134,8 @@
    * %...{Foobar}o:  The contents of Foobar: header line(s) in the reply.
    * %...p:  the port the request was served to
    * %...P:  the process ID of the child that serviced the request.
  + * %...{format}P: the process ID or thread ID of the child/thread that
  + *                serviced the request
    * %...r:  first line of request
    * %...s:  status.  For requests that got internally redirected, this
    *         is status of the *original* request --- %...>s for the last.
  @@ -611,9 +613,21 @@
       return ap_escape_logitem(r->pool, ap_get_server_name(r));
   }
   
  -static const char *log_child_pid(request_rec *r, char *a)
  +static const char *log_pid_tid(request_rec *r, char *a)
   {
  -    return apr_psprintf(r->pool, "%ld", (long) getpid());
  +    if (*a == '\0' || !strcmp(a, "pid")) {
  +        return apr_psprintf(r->pool, "%" APR_PID_T_FMT, getpid());
  +    }
  +    else if (!strcmp(a, "tid")) {
  +#if APR_HAS_THREADS
  +        apr_os_thread_t tid = apr_os_thread_current();
  +#else
  +        int tid = 0; /* APR will format "0" anyway but an arg is needed */
  +#endif
  +        return apr_psprintf(r->pool, "%pT", &tid);
  +    }
  +    /* bogus format */
  +    return a;
   }
   
   static const char *log_connection_status(request_rec *r, char *a)
  @@ -1374,7 +1388,7 @@
           log_pfn_register(p, "V", log_server_name, 0);
           log_pfn_register(p, "v", log_virtual_host, 0);
           log_pfn_register(p, "p", log_server_port, 0);
  -        log_pfn_register(p, "P", log_child_pid, 0);
  +        log_pfn_register(p, "P", log_pid_tid, 0);
           log_pfn_register(p, "H", log_request_protocol, 0);
           log_pfn_register(p, "m", log_request_method, 0);
           log_pfn_register(p, "q", log_request_query, 0);
  
  
  

Mime
View raw message