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

Re: can apache log to MySQL ?



On Sat, May 13, 2000 at 08:57:50PM -0400, Chris Wagner wrote:
> At 07:24 PM 5/13/00 -0500, Nathan E Norman wrote:
> >So what happens when you're reading the requests database and Apache
> >wants to write more data?  With MySQL, the table is locked and now you
> >just lost data.  More often, you want to read data but the writer has
> >locked the table.  I'd noticed this before but hadn't really thought
> >about the issue.  
> 
> That's all solved by a wonderful little tool called savelog.  Your database
> proggy should not be allowed to touch the log file until it is closed and
> rotated out of production.  Have a cron script using SQL parse the log file
> after it has been rotated.

WHAT log file?  The database table is the "log file" ... there's no
transferlog on disk in the form of a file.  The object of the game (in
this thread anyway) is to get Apache to write directly to a database.
You can do that with mod_perl or by piping the log output to a perl
script that knows what to do.  See Craig's sample script a few posts
back in this thread.

This is cool because you don't have several hundred open file
descriptors, and you can generate up-to-date site statistics which
gives your users a woody.

However, you CAN'T do all that if your database is blocking because
the table is locked!

I can't see why I'd want to load some old rotated log file into a database;
I'd rather just run analog on it at that point.  However, I don't want
to have a few hundred log files for all my different virtual hosts.

Cheers,

-- 
Nathan Norman         "Eschew Obfuscation"          Network Engineer
GPG Key ID 1024D/51F98BB7            http://home.midco.net/~nnorman/
Key fingerprint = C5F4 A147 416C E0BF AB73  8BEF F0C8 255C 51F9 8BB7

Attachment: pgpo1g4Kfm4CB.pgp
Description: PGP signature


Reply to: