Re: logging at startup

[prev] [thread] [next] [Date index for 2004/11/10]

From: Arshavir Grigorian
Subject: Re: logging at startup
Date: 21:09 on 10 Nov 2004
Perrin Harkins wrote:

>On Wed, 2004-11-10 at 10:11, Arshavir Grigorian wrote:
>  
>
>>The problem is that when the module is loaded there is no request object 
>>and I am not sure how I can use log_error without it.
>>    
>>
>
>Are you in a request at the time when the error happens?  If so, you can
>get a request object by calling Apache->request().  If not, you won't be
>able to send any HTML anyway, so just print a message to STDERR.
>
>- Perrin
>
>  
>
Thanks. No I am not in a request because this is happening as the server 
is starting up and the module is being loaded (startup.pl).
How can I write my code to know whether it is in a request and only if 
so, output the standard error page. Calling Apache->request() when there 
is no request gives an error (Can't locate object method "request" via 
package "Apache"). Should I do something like:

eval {
    $r = Apache->request();
}

if (! $@) {
      # we have a request, dump the error page
}

On a separate note, why would one even bother with 
Apache::Log->log_error? instead of just using CGI::Carp (for 
simple/basic error loggin that is

I am just trying to wrap my head around the many ways of doing the same 
thing, so any comments you might have would be very much appreciated.


Arshavir

        -- 
        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

(message missing)

logging at startup
Arshavir Grigorian 15:11 on 10 Nov 2004

Re: logging at startup
Perrin Harkins 20:21 on 10 Nov 2004

Re: logging at startup
Arshavir Grigorian 21:09 on 10 Nov 2004

Re: logging at startup
Tom Schindl 21:37 on 10 Nov 2004

Re: logging at startup
Arshavir Grigorian 14:57 on 12 Nov 2004

Re: logging at startup
Perrin Harkins 21:42 on 10 Nov 2004

segmentation fault and core dump
Ian Moon 23:17 on 10 Nov 2004

Re: segmentation fault and core dump
Stas Bekman 23:56 on 10 Nov 2004

Re: logging at startup
Arshavir Grigorian 14:56 on 12 Nov 2004

Re: logging at startup
Arshavir Grigorian 00:07 on 16 Nov 2004

Re: segmentation fault and core dump
Ian Moon 01:15 on 11 Nov 2004

Re: segmentation fault and core dump
Stas Bekman 03:41 on 11 Nov 2004

Generated at 11:26 on 21 Dec 2004 by mariachi v0.52