[squid-users] Re: authenticate_program bombs out

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Tue, 27 Mar 2001 10:54:49 +0200

Mike Everest wrote:

> > a) Use a "log-tail daemon" that reads Squid's log file and
> > forwards the
> > entries to a SQL server, combined with semi-frequent log rotation to
> > keep the on-disk size down.
> i'd thought about that, but i want to also use the log data to manage a
> 'download quota' system so it really needs to be kept reasonably up to date.

A log tail daemon keeps the SQL data up to date. There might be a
seconds gap or so, but not much more if the SQL server can keep up...

> > b) Logging to a pipe where another daemon listens, completely avoiding
> > touching disk.
> now *that* sounds interesting - any ideas where i might be able to get some
> further info on how to do that?

Personally I prefer the log-tail approach, but in UNIX you do this by

   mknod p /path/to/log/file
   sql_logger </path/to/log/file

How to do something like this on WIN32 I have no idea.

> umm, so are you suggesting that the log daemon can read the log file even
> while sqid is writing to it? i am not at all familiar with how that could
> be achieved - could you point me to some resources?

Quite simple. The log-tail daemon opens the log and then watches the
filesize of it, reading data when the file has grown. (actually, it is
sufficient to just read until EOF, sleep a little and then retry).

The UNIX command tail is one tool for doing this:

  tail +0f /path/to/log/file | sql_logger

Henrik Nordstrom
Squid hacker
Received on Tue Mar 27 2001 - 01:54:06 MST

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