Patch: Apache-like extended log format

From: Michael A Nachbaur <mike@dont-contact.us>
Date: Thu, 27 Jun 2002 02:47:14 -0700

I'm not sure if this is the proper place to post this, but I didn't want to go to the trouble of getting a CVS account or anything. If you don't want the boring prolog, skip ahead.

<preface>
I'm using Squid as a simple HTTP accelerator in front of my Apache/mod_perl webserver, and I use AWStats to view my log information. Or at least I did until I went to Squid. The current logging support is just too restrictive; the common log format is just too simple.

I noticed that Squid 2.4 has support (if enabled at compile time) for separate referer and user agent log files, though I couldn't find any (easy) way to unify all three log files into one extended format log file. Additionally, I couldn't find any scripts online (though I did a bunch of searching) that would do what I wanted.
</preface>

Now, I'm a Perl programmer, and avoid C whenever possible, though I still know enough to be dangerous. Tonight I whipped up a patch to Squid to enable the apache extended log format, by adding "emulate_apache_log". It works the same way as emulate_httpd_log, but adds the referrer and user agent. There might be a more elegant way to accomplish this than I did it, but hey, C isn't my everyday language (it's been over 4 years since I've done anything serious in C).

I don't know what'll happen if you enable both httpd and apache log options, but I suspect either a) it'll default to httpd, or b) worlds will collide.

If I'm out of place posting here, this has already been done, or I've unwittingly broken some nasty rule of netiquette, please let me know.

Time for bed...Cheers.

-- 
Michael A Nachbaur
OpenSource: Every now and then, you get what you don't pay for.

Received on Thu Jun 27 2002 - 04:32:37 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:15:42 MST