You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Colin Wetherbee <cw...@denterprises.org> on 2007/12/15 01:07:46 UTC
No log() in Apache2::RequestRec?
Based on some documentation I read [0] [1], I am trying to use the
following function to write messages to my virtual host's error log.
30 sub Debug(@)
31 {
32 my $r = Apache2::RequestUtil->request;
33 $r->log->debug(@_);
34 }
I have tried several variations of this, restarting the server as
necessary, and I get the following error.
[Fri Dec 14 23:57:52 2007] [error] [client 192.168.171.80] Can't locate
object method "log" via package "Apache2::RequestRec" at
/home/cww/sites/js.iron.denterprises.org/htdocs/jet-set/JetSet/Debug.pm
line 33.\n
I remember using code similar to this for logging in the past, and it
worked fine. Unfortunately, I don't have (or can't find) that code anymore.
This is Apache/2.2.6 (Debian) mod_apreq2-20051231/2.6.0 mod_perl/2.0.3
Perl/v5.8.8.
I would appreciate any pointers.
Thanks.
Colin
[0] http://perl.apache.org/docs/2.0/api/Apache2/RequestUtil.html#C_request_
[1] http://perl.apache.org/docs/2.0/api/Apache2/Log.html#LogLevel_Methods
Re: No log() in Apache2::RequestRec?
Posted by Colin Wetherbee <cw...@denterprises.org>.
Fred Moyer wrote:
> Colin Wetherbee wrote:
>> [Fri Dec 14 23:57:52 2007] [error] [client 192.168.171.80] Can't
>> locate object method "log" via package "Apache2::RequestRec" at
>> /home/cww/sites/js.iron.denterprises.org/htdocs/jet-set/JetSet/Debug.pm
>> line 33.\n
>
> use Apache2::Log ();
>
> should take care of it.
Well, that was easy enough.
Thanks.
Colin
Re: No log() in Apache2::RequestRec?
Posted by Fred Moyer <fr...@redhotpenguin.com>.
Colin Wetherbee wrote:
> Based on some documentation I read [0] [1], I am trying to use the
> following function to write messages to my virtual host's error log.
>
> 30 sub Debug(@)
> 31 {
> 32 my $r = Apache2::RequestUtil->request;
> 33 $r->log->debug(@_);
> 34 }
>
> I have tried several variations of this, restarting the server as
> necessary, and I get the following error.
>
> [Fri Dec 14 23:57:52 2007] [error] [client 192.168.171.80] Can't locate
> object method "log" via package "Apache2::RequestRec" at
> /home/cww/sites/js.iron.denterprises.org/htdocs/jet-set/JetSet/Debug.pm
> line 33.\n
use Apache2::Log ();
should take care of it.
> I remember using code similar to this for logging in the past, and it
> worked fine. Unfortunately, I don't have (or can't find) that code
> anymore.
>
> This is Apache/2.2.6 (Debian) mod_apreq2-20051231/2.6.0 mod_perl/2.0.3
> Perl/v5.8.8.
>
> I would appreciate any pointers.
>
> Thanks.
>
> Colin
>
> [0] http://perl.apache.org/docs/2.0/api/Apache2/RequestUtil.html#C_request_
> [1] http://perl.apache.org/docs/2.0/api/Apache2/Log.html#LogLevel_Methods