perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Graf László <graf.las...@axis.hu>
Subject Log::Log4perl
Date Tue, 20 Apr 2004 06:35:10 GMT
Hi gurus

I have the following configuration:

    UHU-Linux 1.1 (www.uhulinux.hu)
    httpd-2.0.49
    perl 5.8.3
    mod_perl-1.99_13
    Log::Log4perl 0.41

The problem is that, the Log::Log4perl used within test.pl (see below)
works fine, entering the "test message" into the /var/log/log4perl.log
file, each time when I run x.pl. Used within RequestHandler.pm (see below)
it does not work.

What is wrong ?
Thank you.




RequestHandler.pm
-----------------
package GL::BASE::RequestHandler;
@ISA = qw();
use Log::Log4perl;
Log::Log4perl::init('/etc/log4perl.conf');
$logger = Log::Log4perl->get_logger('GL::BASE::RequestHandler');
sub handler ($$) {
	my($r) = @_;
	$logger->error("in");
	$logger->error("out");
	return 0;
}
1;
#__END__


log4perl.conf
-------------
log4perl.rootLogger=ERROR, LOGFILE
log4perl.appender.LOGFILE=Log::Log4perl::Appender::File
log4perl.appender.LOGFILE.filename=/var/log/log4perl.log
log4perl.appender.LOGFILE.mode=append
log4perl.appender.LOGFILE.layout=PatternLayout
log4perl.appender.LOGFILE.layout.ConversionPattern=[%r] %F %L %c - %m%n


httpd.conf
----------
PerlInitHandler Apache::Reload
# PerlSetVar ReloadDebug On
# PerlSetVar ReloadModules "GL::*"
Alias /p/ /proba/
<Location /proba/>
      SetHandler perl-script
      PerlHandler GL::BASE::RequestHandler->handler
</Location>


test.pl
-----
#!/usr/bin/perl
use Log::Log4perl;
Log::Log4perl::init('/etc/log4perl.conf');
$logger = Log::Log4perl->get_logger('GL::PSP::RequestHandler');
x();
sub x {
	$logger->error("test message");
	return 0;
}

-- 
Graf László


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Mime
View raw message