Redirecting stderror to a browser

Roy Smith roy at popmail.med.nyu.edu
Mon Dec 20 09:37:24 EST 1999


NULL at my.pc wrote:
> Using Python 4 CGI, I'd like to redirect the errors to the browser window, 
> so I get meaningfull errors rather than the typical "500 Internal server error". 
> I guess I could redirect it to a file, but seing immediately on the browser 
> would be much faster to work with.

Assuming your server is on a unix machine, what I find works well for me is to 
open two windows to the server machine; one to edit my cgi code in, and another 
to run "tail -f error_log" in.  The "-f" argument tells "tail" to keep watching 
the file to see if it grows and print stuff out as soon as it appears.  The end 
result is that if my cgi produces anything on stderr, it instantly shows up in 
my 2nd window.

-- 
Roy Smith <roy at popmail.med.nyu.edu>
New York University School of Medicine




More information about the Python-list mailing list