Question about logging to APACHE

Question about logging to APACHE

Post by Max Adam » Sat, 13 Apr 2002 06:26:51



I have apache serving a domain for example www.xyz.com and a virtual host
running on vhost1.xyz.com.  I currently have them both logging to the same
file called custom.logs.

However there is a file called index.html on both the domain and on the
virtual host.  This causes problems because on the name is logged
(index.html) and I have no way of knowing if this file is the domain root or
the virtual host.

I would like them both to log to the same log file because we are using
accesswatch to analyse the log file.

I have two alternatives
1) use two log files one for the domain and a second for the virtual host

or

2) somehow store index.html to show that it is an access from the virtual
host not the domain

Which do you recommend, i.e. which is best practice?
How can I log index.html to show that it is coming from the virtual domain?

--
Thanks lots
Max

 
 
 

1. Apache logging module for breaking logs daily, CERN-style?

hello,

We switched to Apache from CERN and are really enjoying the increased
speed and new features.

However, there are a few things that CERN did which Apache does not
do. One of these is wildcards in mappings, but I have already posted
asking about that several times with no response. :-(

The one I need at the moment is the ability for the server to break
it's log files on a daily boundary - in this case, midnight.

The CERN httpd could do this automatically, and I am interested in
doing this in Apache since it will save us quite a bit of work in the
long run.

I intend to implement this feature as a modification to the experimental
logging module.

The log files will be saved with names in [logname].Jan0195 format.

Is this task complicated by the fact that there are multiple processes
sharing the log's file descriptor? At first glance, it doesn't seem so.
It appears to be a simple check before each log line is written - if
the date is different than that represented by the current file desc,
close it and open a new one with today's date included in the name.

At second glance, I have these questions:

Will there be a problem with multiple children opening the log file in
append mode?

Are the children unable to open the file because they don't have the
proper permissions?

Does the real solution involve having the parent open the log file and
restart it's children at midnight?

Is there any way to do this with a preforking type server?

This is more difficult than I thought!

thank you for your time,

Dwayne Fontenot

2. Linux and Novell

3. Can you log specific cookies with Apache %{cookie}i log format?

4. "Can't open file" ( flat file ) and "flock()unimplemented ..."

5. Apache Logs : wrong entries in log files

6. Named Question!

7. Apache 1.3.12 access.log logging error

8. String Problem

9. Apache logging virtual hosts in one log file

10. Apache and logging: Selective logging?

11. Apache: Proxy not logged, other accesses logged?

12. Apache- Multiple logs (log for each user Q:How do I?)

13. apache log directory, restarting server after rotating logs.