From: Bill Stoddard Date: Fri, 3 Nov 2000 03:08:31 +0000 (+0000) Subject: Merge the 1.3 patch to add support for logging query string in X-Git-Tag: APACHE_2_0_ALPHA_8~181 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=760b659c6686aeba29a6addb84487615b1999c78;p=apache Merge the 1.3 patch to add support for logging query string in 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 --- diff --git a/modules/loggers/mod_log_config.c b/modules/loggers/mod_log_config.c index c48d545a86..dbadb25d75 100644 --- a/modules/loggers/mod_log_config.c +++ b/modules/loggers/mod_log_config.c @@ -149,7 +149,8 @@ * %...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 },