httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grega...@apache.org
Subject Re: how to log what status was returned by a cgi script
Date Wed, 01 Oct 2003 17:06:55 GMT
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


Mime
View raw message