cronolog.org
flexible web log rotation
HOME
DOWNLOAD
FEATURES
USAGE
FAQ
BLOG
KNOWN BUGS
SECURITY
PATCHES
USERS
TO DO
HISTORY
LINKS
FEEDBACK
MAILING LIST
ADVERTISING

support cronolog development



Google   HELP


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CRONOLOG: [help] OSX & Cronolog: Newbie



We ended up creating one 'overall' log for all our virtual hosts. If
you want to do this I can give more instructions.

This would be a most helpful HOWTO... would be hugely grateful for any info
you can provide on it!

In the httpd.conf we created our own custom log format to capture more information about virtual hosts...


LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %U %T %p %P %v %f %V" ourlogs

which we added to the bottom of the default sets...

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %U %T %p %P %v %f %V" ourlogs


...but you can use any of the default ones if you want.

We then added a line to pipe the output to cronolog...

CustomLog "|/bin/cronolog /private/var/log/httpd/archive/%Y%m/%Y-%m-%d.log" ourlogs

Then in httpd_macosxserver.conf we removed all the Apple logging from the virtual hosts...

#CustomLog "/private/var/log/httpd/access_log" "%{PC-Remote-Addr}i %l %u %t \"%r\" %>s %b"

This does mess with Apple's GUI tools though. If you edit a site using the 'Server Settings' tool it will try to put it's own logging lines back in and give error messages saying a site couldn't be added/edited (even though it does really make the changes).

To get round that we added our own include to httpd.conf

Include /private/etc/httpd/ourhttpd.conf

just above Apple's one

Include /private/etc/httpd/ourhttpd.conf
Include /private/etc/httpd/httpd_macosxserver.conf
Include /private/etc/httpd/mime_macosxserver.types

We now edit ourhttpd.conf by hand and just use the 'Server Settings' tool to stop and start Apache.

Cheers

Paul




Copyright © 1996-2010 Andrew Ford and Ford & Mason Ltd