[Melbourne-pm] mod_perl quirks
Alex Balhatchet
kaoru at slackwise.net
Fri Jan 9 01:09:32 PST 2015
Hi Mathew,
We're using mod_perl extensively at Nestoria and I don't think we've
ever seen these errors in our apache error logs.
We're on apache 2.2.29 and mod_perl 2.0.8.
Do you know what phase the errors are occurring in?
http://perl.apache.org/docs/2.0/user/handlers/server.html
- Alex
On 8 January 2015 at 22:44, Mathew Robertson
<mathew.blair.robertson at gmail.com> wrote:
> Hi PM,
>
> During the mod-perl vs other frameworks discussion, I remembered one
> particular annoyance of mod-perl... all the mod-perl error-log messages
> saying stuff like:
>
>
> Constant subroutine redefined
> PV = SV
> REFCNT
> FLAGS
> ...
>
> I have scoured the web trying to determine what/where this comes from -
> eventually identifying the problem as "yeah Mod-Perl does that... they are
> only warnings so just ignore them". But alas that just fills up the Apache
> errorlog. And no amount of Apache error-level settings changed this
> behaviour.
>
> So eventually I came up with this... any other solutions?
>
> regards,
> Mathew
>
>
>
> In apache2.conf :
>
> ErrorLog "||/usr/local/bin/apache_log_filter.pl
> ${APACHE_LOG_DIR}/error.log"
>
> In /usr/local/bin/apache_log_filter.pl :
>
> #!/usr/bin/perl
> use strict;
> use warnings FATAL => 'all';
> use utf8;
>
> my $logfile = $ARGV[0] or die "Missing logfile name";
> open(LOG,">>",$logfile) or die "Failed opening: $logfile";
> select((select(LOG), $|=1)[0]);
> my $last = '';
> my $catch_at;
> while(<STDIN>) {
> $last = $_ unless /^ at .* line \d+/;
> if (/^Prototype mismatch/) {
> $catch_at = 1;
> next;
> }
> next if /^Constant subroutine/;
> next if /^SV = /;
> next if /^ REFCNT /;
> next if /^ FLAGS /;
> next if /^ PV /;
> next if /^PV\(0x.*\) at 0x/;
> if (/^ at .* line \d+/) {
> if ($catch_at) {
> $catch_at = 0;
> next;
> }
> print LOG $last;
> print LOG $_;
> next;
> }
> print LOG $_;
> }
>
>
> _______________________________________________
> Melbourne-pm mailing list
> Melbourne-pm at pm.org
> http://mail.pm.org/mailman/listinfo/melbourne-pm
More information about the Melbourne-pm
mailing list