[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cgiapp] Re: A bit off topic - CGI:Application and CGI::Carp


In article <suppressed>, Irubin Consulting wrote:
> 
> 
>>
>> In article <suppressed>, Irubin
>> Consulting wrote:
>> > Hello,
>> >
>> > I am trying to write an error handling routine, so that the
>> errors from my
>> > CGI::Application are displayed in the browser. I have set a runmode of
>> > 'error500' which is called by default every time a 500 error occurs (via
>> > ErrorDocument in the .htaccess files). Below is the code for
>> that runmode.
>> >
>> > How can I also display the exact error as formatted by
>> CGI::Carp (and not
>> > just "Premature end of script headers"). Is this possible?
>>
>> Yes. Send the Carp output to STDERR or an error log. To access it,
>> read in the last 50 lines or so of that error log and display them in
>> the browser.
>>
>> I have been doing something like that on our development web server for
>> a while and it works fairly well.
>>
>> 	Mark
> 
> Mark,
> 
> Can you please post an example.

use CGI;
my $q = new CGI;

my $error_log_tail = $q->escapeHTML(`tail -10 /home/develop/logs/httpd-error_log`);

############

That's the meat of how I get at the log file. I'm sure there is a Pure
Perl way to do it as well.

	Mark



---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.