You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Peter W <pe...@usa.net> on 1999/10/16 17:53:18 UTC

[PATCH] finally, mod_log_config hook for query string for 1.3

As discussed in late September, this is based on the "19991016131218" CVS
snapshot. Diffs for both the C code and the HTML manual. With this
addition, "%m %U%q %H" can replace "%r" for those like me who want to
modify the apparent path.

Thanks,

-Peter

*** apache-1.3/src/modules/standard/mod_log_config-old.c	Sat Oct 16 11:17:15 1999
--- apache-1.3/src/modules/standard/mod_log_config.c	Sat Oct 16 11:26:34 1999
***************
*** 144,150 ****
   * %...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
--- 144,151 ----
   * %...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
!  * %...q:  the query string prepended by "?", or empty if no query string
   *
   * 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
***************
*** 346,351 ****
--- 347,357 ----
  {
      return r->protocol;
  }
+ static const char *log_request_query(request_rec *r, char *a)
+ {
+     return (r->args != NULL) ? ap_pstrcat(r->pool, "?", r->args, NULL)
+                              : "";
+ }
  static const char *log_status(request_rec *r, char *a)
  {
      return pfmt(r->pool, r->status);
***************
*** 539,544 ****
--- 545,553 ----
      },
      {
          'm', log_request_method, 0
+     },
+     {
+         'q', log_request_query, 0
      },
      {
          '\0'

*** apache-1.3/htdocs/manual/mod/mod_log_config-old.html	Sat Oct 16 11:35:59 1999
--- apache-1.3/htdocs/manual/mod/mod_log_config.html	Sat Oct 16 11:38:00 1999
***************
*** 149,154 ****
--- 149,156 ----
  %...V:          The server name according to the UseCanonicalName setting.
  %...m		The request method
  %...H		The request protocol
+ %...q		The query string (prepended with a ? if a query string exists,
+                 otherwise an empty string)
  </PRE>
  
  The `...' can be nothing at all (<EM>e.g.</EM>, <CODE>"%h %u %r %s %b"</CODE>), or it can