martin 99/12/15 15:04:27
Modified: src CHANGES htdocs/manual/mod mod_log_config.html src/modules/standard mod_log_config.c Log: Peter Watkins writes: 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 PR: 5174 Submitted by: Peter Watkins <[EMAIL PROTECTED]> Reviewed by: Martin Kraemer Revision Changes Path 1.1480 +5 -0 apache-1.3/src/CHANGES Index: CHANGES =================================================================== RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1479 retrieving revision 1.1480 diff -u -r1.1479 -r1.1480 --- CHANGES 1999/12/15 22:13:22 1.1479 +++ CHANGES 1999/12/15 23:04:07 1.1480 @@ -1,5 +1,10 @@ Changes with Apache 1.3.10 + *) Add %q logging format directive (logs "?" and the query string part + of a query, or the empty string if no query). + Can be used in combination with %m, %U and %H: "%m %U%q %H" is the + same as "%r". [Peter Watkins <[EMAIL PROTECTED]>] + *) Improve OS390 port to work on older system releases [Paul Gilmartin <[EMAIL PROTECTED]>] 1.36 +9 -7 apache-1.3/htdocs/manual/mod/mod_log_config.html Index: mod_log_config.html =================================================================== RCS file: /export/home/cvs/apache-1.3/htdocs/manual/mod/mod_log_config.html,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- mod_log_config.html 1999/10/13 08:41:52 1.35 +++ mod_log_config.html 1999/12/15 23:04:19 1.36 @@ -121,24 +121,28 @@ by the values as follows: <PRE> +%...a: Remote IP-address +%...A: Local IP-address %...B: Bytes sent, excluding HTTP headers. %...b: Bytes sent, excluding HTTP headers. In CLF format i.e. a '-' rather than a 0 when no bytes are sent. -%...f: Filename %...{FOOBAR}e: The contents of the environment variable FOOBAR +%...f: Filename %...h: Remote host -%...a: Remote IP-address -%...A: Local IP-address +%...H The request protocol %...{Foobar}i: The contents of Foobar: header line(s) in the request sent to the server. %...l: Remote logname (from identd, if supplied) +%...m The request method %...{Foobar}n: The contents of note "Foobar" from another module. %...{Foobar}o: The contents of Foobar: header line(s) in the reply. %...p: The canonical Port of the server serving the request %...P: The process ID of the child that serviced the request. +%...q The query string (prepended with a ? if a query string exists, + otherwise an empty string) %...r: First line of request -%...s: Status. For requests that got internally redirected, this - is status of the *original* request --- %...>s for the last. +%...s: Status. For requests that got internally redirected, this is + the status of the *original* request --- %...>s for the last. %...t: Time, in common log format time format (standard english format) %...{format}t: The time, in the form given by format, which should be in strftime(3) format. (potentially localised) @@ -147,8 +151,6 @@ %...U: The URL path requested. %...v: The canonical ServerName of the server serving the request. %...V: The server name according to the UseCanonicalName setting. -%...m The request method -%...H The request protocol </PRE> The `...' can be nothing at all (<EM>e.g.</EM>, <CODE>"%h %u %r %s %b"</CODE>), or it can 1.80 +10 -1 apache-1.3/src/modules/standard/mod_log_config.c Index: mod_log_config.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_log_config.c,v retrieving revision 1.79 retrieving revision 1.80 diff -u -r1.79 -r1.80 --- mod_log_config.c 1999/09/27 20:38:46 1.79 +++ mod_log_config.c 1999/12/15 23:04:22 1.80 @@ -144,7 +144,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 @@ -346,6 +347,11 @@ { 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,6 +545,9 @@ }, { 'm', log_request_method, 0 + }, + { + 'q', log_request_query, 0 }, { '\0'