>Number: 5174 >Category: mod_log-any >Synopsis: [PATCH] mod_log_config hook for query string for 1.3 >Confidential: no >Severity: non-critical >Priority: medium >Responsible: apache >State: open >Class: change-request >Submitter-Id: apache >Arrival-Date: Wed Oct 20 10:30:00 PDT 1999 >Last-Modified: >Originator: [EMAIL PROTECTED] >Organization: apache >Release: 1.3.10-dev >Environment: Linux 2.0.36 (Red Hat 5.1), gcc 2.7.2.3 >Description: In September, there was discussion of mod_log_config and some need to break the client request "%r" into its separate components. A patch was committed to the 1.3 dev tree that exposed the method and protocol request members as "%m" and "%H". It was noted that "%m %U %H" was not the same as "%r" because %U does not include query string information. The attached patches add support for logging query string in such a way that "%m %U%q %H" is the same as "%r". I would like to see this committed to take care of the unfinished business begun with "%m" and "%H".
Thanks, -Peter >How-To-Repeat: >Fix: Yes. Here are patches for both the C code and the HTML documentation, based on the "19991016131218" CVS snapshot. *** 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 >Audit-Trail: >Unformatted: [In order for any reply to be added to the PR database, you need] [to include <[EMAIL PROTECTED]> in the Cc line and make sure the] [subject line starts with the report component and number, with ] [or without any 'Re:' prefixes (such as "general/1098:" or ] ["Re: general/1098:"). If the subject doesn't match this ] [pattern, your message will be misfiled and ignored. The ] ["apbugs" address is not added to the Cc line of messages from ] [the database automatically because of the potential for mail ] [loops. If you do not include this Cc, your reply may be ig- ] [nored unless you are responding to an explicit request from a ] [developer. Reply only with text; DO NOT SEND ATTACHMENTS! ]