handler for error log

2001-06-12 Thread John Saylor

Hi

Is it possible to put a handler on the error log so that certain
elements could be filtered? Ideally, I'd like to keep track of how many
times a certain error appears and with a handler that would be a cake
walk. So the handler would 'live' between the main httpd process and the
file, doing it's magic there.

I've done some searching and found nothing [other than people
complaining about their CGI scripts].

Any pointers or suggestions are welcome.

-- 
\js

Wayne's World C Programming Style Guide:
A == B; !;

(A equals B. Not!)



Re: handler for error log

2001-06-12 Thread Steven Lembark


 Is it possible to put a handler on the error log so that certain
 elements could be filtered? Ideally, I'd like to keep track of how
 many times a certain error appears and with a handler that would be a
 cake walk. So the handler would 'live' between the main httpd process
 and the file, doing it's magic there.

 I've done some searching and found nothing [other than people
 complaining about their CGI scripts].

 Any pointers or suggestions are welcome.

There are several log watchers avaialble, including ones written
in perl.  One simple trick is to essentially tail -f the thing into a
regex.  Quick way is to seek to the end, store -M $logfile and set
$\ = undef.  After that:

open my $logfile,  $logpath or croak $logpath: $!;

undef $\; # or leave it alone if reading into an array.

for( my $lastmod = -M $logfile ;;)
{
sleep 10 while( $lastmod == -M $logfile );

my $newstuff  = $logfile;

# regex $newsuff to your heart's delight.
# that or read it as @newstuff and process it
# line by line
}






--
Steven Lembark 
2930 W. Palmer
 
chicago, IL 60647
[EMAIL PROTECTED] 
+1 800 762 1582