You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Jeff Trawick <tr...@attglobal.net> on 2003/09/30 01:27:17 UTC
how to log what status was returned by a cgi script
a cgi script can write this in the response header: "Status: nnn"... it
would sometimes be nice to know if the script did such a thing...
(like a current problem I'm working on: where the heck did the 500 come
from for this CGI; there's nothing in the error log and the few places
in the server that return 500 without logging don't seem like good
suspects; being able to clearly log any status set by the script would
eliminate any rude finger pointing)
how about in ap_scan_script_header_err_core() we set an envvar
(script-status) to the value of the Status field, if provided?
then in a custom log format the script-status envvar can be logged...
or am I missing a way to log this info already? (not the ScriptLog
stuff; this is for a production environment :) )
alternatively, ap_scan_script_header_err_core() could stick something in
the error log for bad http status codes, but that isn't quite as
applicable (though it is automatic)
Re: how to log what status was returned by a cgi script
Posted by gr...@apache.org.
Jeff Trawick wrote:
> a cgi script can write this in the response header: "Status: nnn"... it
> would sometimes be nice to know if the script did such a thing...
>
> (like a current problem I'm working on: where the heck did the 500 come
> from for this CGI; there's nothing in the error log and the few places
> in the server that return 500 without logging don't seem like good
> suspects; being able to clearly log any status set by the script would
> eliminate any rude finger pointing)
>
> how about in ap_scan_script_header_err_core() we set an envvar
> (script-status) to the value of the Status field, if provided?
> then in a custom log format the script-status envvar can be logged...
>
> or am I missing a way to log this info already? (not the ScriptLog
> stuff; this is for a production environment :) )
>
> alternatively, ap_scan_script_header_err_core() could stick something in
> the error log for bad http status codes, but that isn't quite as
> applicable (though it is automatic)
I like your alternative better, because it will just work with no fiddling
necessary. What do you mean by "isn't quite as applicable"?
Greg