perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wojciech Pietron <W.Piet...@itl.waw.pl>
Subject Carpout in mod_perl
Date Wed, 27 Aug 2003 07:55:41 GMT
Solaris 2.5.1
perl 5.6.0
Apache/1.3.27 (Unix) mod_perl/1.27
CGI 2.76
CGI::Carp 1.20 

Hi,

I have problems with redirecting STDERR in mod_perl. Have a look at the
following example:

======================================================
#/usr/bin/perl -w

use CGI qw(header param url_param url);
use CGI::Carp qw(fatalsToBrowser croak carp carpout);

my ($pwd, $errorlog, $fh);

BEGIN {
   $pwd = qx|/bin/pwd|;
   chop $pwd;
   $errorlog = "$pwd/myerror.log";
   $fh = new FileHandle ">> $errorlog";
   carpout($fh);
}

# functions printing to STDERR 
...
======================================================

If I use CGI instead of mod_perl, it is OK. I have all my STDERR messages at
myerror.log.  But when I put my script in mod_perl environment then I have some
of the messages in myerror.log and some in standard Apache error_log file.  If
I run my script a few times, I can see that the message appears randomly either 
in myerror.log or in error_log file.

I am not able to determine when messages are going to myerror.log and when they
are going to error_log. Is it a feature of mod_perl? 

Thank you in advance for your help.
Best regards,
Wojciech Pietron


-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Mime
View raw message