]> granicus.if.org Git - apache/commitdiff
Merge the 1.3 patch to add support for logging query string in
authorBill Stoddard <stoddard@apache.org>
Fri, 3 Nov 2000 03:08:31 +0000 (03:08 +0000)
committerBill Stoddard <stoddard@apache.org>
Fri, 3 Nov 2000 03:08:31 +0000 (03:08 +0000)
such a way that "%m %U%q %H" is the same as "%r".

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86819 13f79535-47bb-0310-9956-ffa450edef68

modules/loggers/mod_log_config.c

index c48d545a86121425714b1341b6a0e581382042a8..dbadb25d755355e80845379506bcea5ae8bcdee5 100644 (file)
  * %...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
+ * %...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
@@ -357,6 +358,11 @@ static const char *log_request_protocol(request_rec *r, char *a)
 {
     return r->protocol;
 }
+static const char *log_request_query(request_rec *r, char *a)
+{
+    return (r->args != NULL) ? apr_pstrcat(r->pool, "?", r->args, NULL)
+                             : "";
+}
 static const char *log_status(request_rec *r, char *a)
 {
     return pfmt(r->pool, r->status);
@@ -584,6 +590,9 @@ static struct log_item_list {
     {
         'm', log_request_method, 0
     },
+    {
+        'q', log_request_query, 0
+    },
     {
         'c', log_connection_status, 0
     },