Magnús Þór Jónsson wrote:
> 
> Hello,
> I was wondering if there is any way of making the error log in Apache to
> execute a script when an error is occurred, perhaps instead of writing the
> error directly to the log.
> 
> For example, if there is a image missing Apache excutes a script that
> generates a replacement image?

well, you can do just about anything you want :)

however, althoughit is possible to intercept the actual errors Apache
(and mod_perl) generates, it is rather complex, and really not the
proper approach here.

the better way is to just write your own handler to add the logic you
are seeking.

for instance, you could write a PerlFixupHandler that

$r->filename('/some/other/file') unless -e $r->finfo;

or whatnot.

if you want a script to run, you could replace the $r->filename('foo')
call with something like

$r->set_handlers(PerlHandler => 'My::ImageGenerating::Package');
$r->handler('perl-script');

or some combination that changed $r->uri if you wanted to use a
Registry script I suppose.

HTH

--Geoff

Reply via email to