Apache::PerlRun flooding error log
[prev]
[thread]
[next]
[Date index for 2005/04/06]
Heya All,
I have an issue at the moment where if there is an error/warning in my
PerlRun script/module then the error/warning is printed as well as the
entire contents of the script being eval'ed. This only occurs when a
string is evaled and Carp stack trace is on. And this can be replicated
easily using a simple test script - like the one below:
--code--
#!/usr/bin/perl
use strict;
use warnings;
use Carp qw(confess cluck);
$SIG{__DIE__} =3D \&Carp::confess;
$SIG{__WARN__} =3D \&Carp::cluck;
my $eval =3D '
package test;
my $a =3D "b";
warn "Blah!\n";
my $b =3D "a";
';
eval $eval;
if (my $err =3D $@) {
print "Eval Failed: \'". $err. "\'\n";
exit;
}
--code--
produces:
--output--
[dj@frost workspace]$ perl test_eval_dump3.pl
Blah!
eval '
package test;
my $a =3D "b";
warn "Blah!\\n";
my $b =3D "a";
;' called at test_eval_dump3.pl line 17
--output--
Now of course when your 'script' is some 60K - and you have a huge
number of hits load balanced across 4 servers - well, we are getting
roughly 10Mb of error log every hour on each server.
Now it seems obvious to either disable stack trace, or overload $SIG
{__WARN__} / $SIG{__DIE__} in something like a PerlTransHandler or
something run before the script - however, once the script runs it will
overload $SIG{__WARN__} e.t.c. with its own. There are far to many
scripts/modules for me to alter so I am wondering if anyone knows of
another sane solution to deal with this?
I mean I would love to be able to do:
ErrorLog My::ErrorLogCleanup /var/log/apache/error_log
and have My::ErrorLogCleanup clean the error message and strip the eval
out with a simple regexp. But i'm not sure how this can be achieved.
Thanks in advance,
David J Radunz
Developer,
Netspace Online Systems
This email and any files transmitted with it are confidential and =
intended solely for the=20
use of the individual or entity to whom they are addressed. Please =
notify the sender=20
immediately by email if you have received this email by mistake and =
delete this email=20
from your system. Please note that any views or opinions presented in =
this email are solely
those of the author and do not necessarily represent those of the =
organisation.=20
Finally, the recipient should check this email and any attachments for =
the presence of=20
viruses. The organisation accepts no liability for any damage caused by =
any virus=20
transmitted by this email.=20
 |
(message missing)
|
 |
 |
Apache::PerlRun flooding error log
David J Radunz 01:10 on 06 Apr 2005
|