Received: (qmail 27383 invoked by uid 2012); 27 Feb 1998 22:14:11 -0000 Message-Id: <19980227221411.27382.qmail@hyperreal.org> Date: 27 Feb 1998 22:14:11 -0000 From: Todd Eigenschink Reply-To: eigenstr@mixi.net To: apbugs@hyperreal.org Subject: Implementation to add a new option to mod_log_config: client IP address X-Send-Pr-Version: 3.2 >Number: 1885 >Category: mod_log-any >Synopsis: Implementation to add a new option to mod_log_config: client IP address >Confidential: no >Severity: non-critical >Priority: medium >Responsible: apache >State: closed >Class: support >Submitter-Id: apache >Arrival-Date: Fri Feb 27 14:20:02 PST 1998 >Last-Modified: Sat Feb 28 00:14:03 PST 1998 >Originator: eigenstr@mixi.net >Organization: >Release: 1.2.5 >Environment: Any. >Description: Add the `a' option to LogFormat to log the client IP address. Patch included. >How-To-Repeat: >Fix: --- mod_log_config.c.orig Mon Feb 9 19:01:12 1998 +++ mod_log_config.c Mon Feb 9 22:00:44 1998 @@ -113,6 +113,7 @@ * %...{FOOBAR}e: The contents of the environment variable FOOBAR * %...f: filename * %...h: remote host + * %...a: remote ip * %...{Foobar}i: The contents of Foobar: header line(s) in the request * sent to the client. * %...l: remote logname (from identd, if supplied) @@ -240,6 +241,9 @@ char *log_remote_host (request_rec *r, char *a) { return (char *)get_remote_host(r->connection, r->per_dir_config, REMOTE_NAME) ; } +char *log_remote_address (request_rec *r, char *a) +{ return r->connection->remote_ip; } + char *log_remote_logname(request_rec *r, char *a) {return (char *)get_remote_logname(r);} @@ -351,6 +355,7 @@ int want_orig_default; } log_item_keys[] = { { 'h', log_remote_host, 0 }, + { 'a', log_remote_address, 0 }, { 'l', log_remote_logname, 0 }, { 'u', log_remote_user, 0 }, { 't', log_request_time, 0 }, %0 >Audit-Trail: State-Changed-From-To: open-closed State-Changed-By: rse State-Changed-When: Sat Feb 28 00:14:03 PST 1998 State-Changed-Why: I've adapted your patch for the 1.3 sources and comitted it together with a corresponding entry in the docs (mod_log_config.html). >Unformatted: [In order for any reply to be added to the PR database, ] [you need to include in the Cc line ] [and leave the subject line UNCHANGED. This is not done] [automatically because of the potential for mail loops. ]