[Zope] Seperate Log Files

Oliver Bleutgen myzope@gmx.net
Tue, 27 Nov 2001 10:45:11 +0100


emf wrote:

> Vid Bijelic wrote:
> 
>> Hi,
>>
>> I have a two (for now) sites running on the same Zope.
>>  Is it possible to have Zope store log files
>> separately for each site, so webalizer can easily
>> generate site statistics for each site separately.
> 
> 
> 
> I generate the log files from apache, as it seems more flexible. THe 
> main thing I had to do was: Store the hostname, and separate the entries 
> by some delimiter I found useful. The entry I use in apache is:
> 
ethan,

I guess you have a reason to do it this way, but I'll just mention 
another method to log multiple domains with apache, perhaps it helps 
someone.

You can also create seperate logfiles in one (virtual host) depending on 
httpd.conf environment variables:

ServerName host1.myhost.com
ServerAlias host2.myhost.com
SetEnvIfNoCase Host "host1" host1_env
SetEnvIfNoCase Host "host2" host2_env
CustomLog /var/log/httpd/host1_log combined env=host1_env
CustomLog /var/log/httpd/host2_log combined env=host2_env

So first we set a variable depending on a substring match of the 
hostname, and then logging is split to two log files.

cheers,
oliver