You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rob Hartill <ro...@imdb.com> on 1997/01/04 22:04:25 UTC

Apache 1.2b4 and ScriptLog (fwd)

Looks like ScriptLog needs better documentation..

acked.

---------- Forwarded message ----------
Date: Sat, 4 Jan 1997 20:35:46 +0000 (GMT)
From: WWW server manager <we...@info.cam.ac.uk>
To: apache-bugs@apache.org
Subject: Apache 1.2b4 and ScriptLog

I just tried using the new ScriptLog directive with Apache 1.2b4, and
tripped over a divergence between reality and my expectations. I'd edited a
perl CGI script to write debugging output to stderr, and added a ScriptLog
directive to the configuration files, but "nothing happened". The log file
didn't get created (and when I created it manually, nothing got written to
it). I eventually tried writing to stdout before the HTTP headers, and that
did result in output to the log, confirming that the log was configured
properly and would be used when the circumstances were appropriate. It had 
seemed so obvious that script stderr would be copied to the log that I 
hadn't gone searching for confirmation, though the documentation says 
nothing either way... Except that the file is described as "the CGI script
error logfile", which to me reads as though it's where stderr will be 
directed!

A quick look through mod_cgi.c suggests that ScriptLog is used only for
things which apache deems to be errors - not, as I'd assumed, as a 
destination for stderr to simplify debugging. Wouldit be possible to copy
script stderr output unconditionally to ScriptLog, i.e. treating any output
to stderr as a reason to log the script details including stderr (but not
treating it as an error unless there actually was an error)?

Looking at the source also prompted another thought - it looks as though 
stderr output from the script is not read until the script terminates or an 
error is detected. Depending on how much buffering is provided by the 
system, couldn't this result in a script which (perhaps accidentally) 
produced "too much" stderr output hanging mysteriously, waiting for the
parent process to read some of the pending data...?

                                John Line
-- 
University of Cambridge WWW manager account (usually John Line)
Send general WWW-related enquiries to webmaster@ucs.cam.ac.uk