You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by James G Smith <JG...@TAMU.Edu> on 2000/05/17 23:49:48 UTC
Re: custom error handling logs 200 status?
Nancy Lin <nl...@library.berkeley.edu> wrote:
>
>Hi
>
>In the mod_perl eagle book, there's a section on writing customer error
>handler (pg 173-174). The example has two scripts. The first one
>GoFish.pm, basically returns a 500 status code and names Carp.pm as the
>custom error handler.
>
>I notice that if I take out the line:
> $r-custom_response(SERVER_ERROR, "/Carp");
>and put in httpd.conf
> ErrorDocument 500 /Carp
>
>it'll work too (verified by telnet'ing to port). However, the access_log
>file will log a 500 status for the original code and a 200 status for the
>other. Why is that?
The log appears to log the status code of the actual response made to the
browser. If the response is done via the ErrorDocument, the server is only
serving an alternate document, which usually succeeds. The custom_response
would not alter the already set status code for the request. This is only
speculation on my part based on what I have seen on my own servers.
--
James Smith <JG...@TAMU.Edu>, 979-862-3725
Texas A&M CIS Operating Systems Group, Unix
Re: custom error handling logs 200 status?
Posted by Nancy Lin <nl...@library.berkeley.edu>.
According to the apache documentation, the custom log directive %s logs
the status of the original request. Isn't that 500 in this case? It says
500 when I telnet to the server.
I don't quite understand your explanation. Can you give more details?
When I have a regular ErrorDocument directive that points to a simple cgi
script or a static html page, it logs the correct status code also. Are
you saying in this case the actual response is a 200? If it is, how/where
did that get set ?
Nancy
On Wed, 17 May 2000, James G Smith wrote:
> Nancy Lin <nl...@library.berkeley.edu> wrote:
> >
> >Hi
> >
> >In the mod_perl eagle book, there's a section on writing customer error
> >handler (pg 173-174). The example has two scripts. The first one
> >GoFish.pm, basically returns a 500 status code and names Carp.pm as the
> >custom error handler.
> >
> >I notice that if I take out the line:
> > $r-custom_response(SERVER_ERROR, "/Carp");
> >and put in httpd.conf
> > ErrorDocument 500 /Carp
> >
> >it'll work too (verified by telnet'ing to port). However, the access_log
> >file will log a 500 status for the original code and a 200 status for the
> >other. Why is that?
>
> The log appears to log the status code of the actual response made to the
> browser. If the response is done via the ErrorDocument, the server is only
> serving an alternate document, which usually succeeds. The custom_response
> would not alter the already set status code for the request. This is only
> speculation on my part based on what I have seen on my own servers.
>