Received: (qmail 14009 invoked by uid 2012); 21 May 1998 13:43:52 -0000 Message-Id: <19980521134352.14008.qmail@hyperreal.org> Date: 21 May 1998 13:43:52 -0000 From: Chris Johnson Reply-To: johnson@isn.dac.neu.edu To: apbugs@hyperreal.org Subject: logging of virtual host access confusing in access.log, errors.log X-Send-Pr-Version: 3.2 >Number: 2262 >Category: mod_log-any >Synopsis: logging of virtual host access confusing in access.log, errors.log >Confidential: no >Severity: non-critical >Priority: medium >Responsible: apache >State: closed >Class: support >Submitter-Id: apache >Arrival-Date: Thu May 21 06:50:01 PDT 1998 >Last-Modified: Thu May 21 10:55:46 PDT 1998 >Originator: johnson@isn.dac.neu.edu >Organization: >Release: 1.3b5 >Environment: uname -a OSF1 www.dac.neu.edu V4.0 564 alpha >Description: This isn't a bug report so much as an observation. When using virtual hosts, the logs log access and errors relative to the virtual host root. This throws off any statistics one would want to generate from the logs. It would be very useful to have a URL or file path translation to indicate that a log entry was a virtual host query and what the real file path was. Virtual hosts might not start at the root of a server but logging as if the access was from the root confuses things greatly. I don't know if this would mess up any log file standards but it would help a lot. >How-To-Repeat: Yes, use virtual hosting. >Fix: See above. But having something in the logs indicating a)that a virtual host was access and b) what the real path was would solve the problem. >Audit-Trail: State-Changed-From-To: open-feedback State-Changed-By: coar State-Changed-When: Thu May 21 07:09:33 PDT 1998 State-Changed-Why: For the access log, you can use a different log format to include the name of the virtual host involved; see the src/support/split-logfile script. As for the error log.. can you give an example of an error message you find confusing in this way? From: Chris Johnson To: coar@hyperreal.org Cc: apache-bugdb@apache.org, apbugs@apache.org, coar@apache.org, Chris Johnson Subject: Re: general/2262: logging of virtual host access confusing in access.log, errors.log Date: Thu, 21 May 1998 10:38:56 -0400 (EDT) On 21 May 1998 coar@hyperreal.org wrote: > [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. ] > > > Synopsis: logging of virtual host access confusing in access.log, errors.log > > State-Changed-From-To: open-feedback > State-Changed-By: coar > State-Changed-When: Thu May 21 07:09:33 PDT 1998 > State-Changed-Why: > For the access log, you can use a different log format > to include the name of the virtual host involved; see > the src/support/split-logfile script. As for the error > log.. can you give an example of an error message you > find confusing in this way? > I'm concerned about access_log. The error_log seems to work. I checked out src/support/split-logfile. It takes access_log as STDIN. It then assumes (?!) that the first field of each line is a virtual host designation. It then proceeds to split things up into files by that name. The first field in my access_log is an IP number not a virtual host designation, at least not a ser er virtual host name. I'm unclear as to how this is going to help tell the different between log entries which reference the real host name root vs references which access a server virtual host name that points to a directory farther down the tree than the root. They look the same in the log as far as I can tell. Maybe I'm just slow today. ------------------------------------------------------------------------------- Chris Johnson |Internet: johnson@isn.dac.neu.edu Assistant Director, Systems |Web: http://www.dac.neu.edu/dac/c.johnson Division of Academic Computing |Voice: 617.373.3300 Northeastern University, 39 RI |FAX: 617.373.8600 360 Huntington Ave. |Life n, something from which nobody escapes Boston, MA., U.S.A. 02115 |alive. Me ------------------------------------------------------------------------------- Comment-Added-By: coar Comment-Added-When: Thu May 21 08:38:33 PDT 1998 Comment-Added: I guess I was being excessively cryptic. I pointed you to split-logfile as an example of how you could include the virtual host name in your access log. Or, if you don't want to pollute your main access log, you can always create another one with an alternate format by using the CustomLog directive. Prefixing the format with something like "{%{Host}i|%v}" will result in each record starting with the name of the virtual host that was requested, and the name of the vhost that actually serviced the request. From that, the URI field, and your knowledge of each vhost's DocumentRoot, Alias, and ScriptAlias settings you should be able to map the request to an actual file. Or are you asking for a log field descriptor that includes the name of the file actually served? What would you have it do if there *wasn't* a file involved (such as the output from mod_status)? State-Changed-From-To: feedback-closed State-Changed-By: coar State-Changed-When: Thu May 21 10:55:45 PDT 1998 State-Changed-Why: One log per vhost is very common - but be sure to check out question #20 in the Apache FAQ (online at . If you're not running a lot of vhosts, this is probably the best solution for you. I'm not sure what %f will do if there's no file associated with the request (such as the mod_status example I cited earlier). It's a good idea to keep an eye on %v if you start finding documents getting served by the wrong vhosts. It sounds as though you're on your way, so I'll close this report. Thanks for using Apache! Category-Changed-From-To: general-mod_log-any Category-Changed-By: coar Category-Changed-When: Thu May 21 10:55:45 PDT 1998 >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. ]