www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefek Zaba <stefek_z...@hp.com>
Subject general/8146: 1.3.x logfiles show only client IP addr; can change to gethostbyaddr in 1 line
Date Mon, 06 Aug 2001 17:34:44 GMT

>Number:         8146
>Category:       general
>Synopsis:       1.3.x logfiles show only client IP addr; can change to gethostbyaddr in
1 line
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          change-request
>Submitter-Id:   apache
>Arrival-Date:   Mon Aug 06 10:40:00 PDT 2001
>Originator:     stefek_zaba@hp.com
>Release:        1.3.20
An old version of apache (1.2.5) used to put hostnames, rather than dotted-quad
addresses only, into the error_log file, according to the setting of the
HostnameLookups directive. By 1.3.20 this has changed to dotted-quads only, and
the source (line 398 of src/main/http_log.c) makes the comment "TODO: add a
method of selecting whether logged client addresses are in dotted quad or
resolved form". 

There's a one-line fix to get this functionality: change the
last arg in the call to ap_sprintf from r->connection->remote_ip to
  ap_get_remote_host(r->connection, r->per_dir_config, REMOTE_NAME)
This already-written routine already does the checks for HostnameLookups, doing
a once-only optimisation (admittedly only per connection, not per-IP-addr as 
the external post-processing tool "logresolve" does).

In these times of the CodeRed worm flap, I find it useful on lower-volume
webservers to have the client name directly in the logfile, rather than needing
to do post-processing to map IP addrs to hostnames.
Design decision present in 1.3.20 (and probably earlier versions).
See above: one-line patch to call existing routine. Warning - I'm no apache
hacker, I've just coded this by symmetry with other calls to get_remote_host;
but it Works Fine For Me :-)
 [In order for any reply to be added to the PR database, you need]
 [to include <apbugs@Apache.Org> 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!     ]

View raw message