Hi Ged, On Wed, Jul 16, 2003 at 07:06:43AM +0100, Ged Haywood wrote: > On Tue, 15 Jul 2003, Jez Hancock wrote: > > Does anyone how one could log errorlog entries in a similar manner to > > the script above - ie pipe the errorlog to a script which appends one > > copy of the error entry to a main error logfile and another copy to the > > virtual host's error logfile? > It's possible, but I don't think you really want to do it. You would > be asking the server to do more than is necessary while handling each > request (you probably already are:). This was my reason for considering using mod_perl :)
> Would it not be better for example to rotate your logs frequently, and > to process them afterwards, off-line? You would then have a choice of > doing things with the various log file analysis tools too. If you are > a little bit creative in what you log, it can be simple to extract the > information you need for each vhost from one file. I would do this but we wanted to give our users 'live' logfiles, rather than making them wait until log rotation before being able to view them (or did I misunderstand you?). > Have you considered using something other than flat files for logging? We started looking at mod_log_sql: http://www.grubbybaby.com/mod_log_sql/ but had trouble getting it to work on FreeBSD unfortunately. The plan was to log everything to a central MySQL (or pgsql) db table, a copy to the vhost's logging table, same with errors (gawd knows how intense this would be on the system). Then when a user wanted to view their logfiles, they'd login to their control panel and request to view only the files they were interested in. At this point a static copy of the log they requested would be created in the filesystem and (optionally) a compressed copy transferred to them in the browser. To be honest I don't know about the above. First of all it requires a lot of DB transactions which would probably mean using pgsql to be safe. Secondly there's the CGI coding that would need to be done and I don't know how efficient or practical such a CGI script would really be. Finally I prefer the idea of user's automatically just getting a set of logfiles created directly to the filesystem. Right now it seems a bit silly having a separate ErrorLog line in each of the apache virtual host stubs, but as far as I am aware there isn't an easier way is there? -- Jez http://www.munk.nu/