Tracing CGI?

There is a problem:

CGI: STDOUT→Captured by webserver; sent to browser
STDERR→Captured by webserver; sent to error log