A
anne001
"With some execution environments, it is be possible to have the error
message and stack backtrace presented to you in the browser window when
the error occurs. If you can configure your server that way, you'll
find that debugging goes much faster"
I have found this site for perl cgi which seems relevant, but can't
find the ruby cgi info
----------->
Q4.4: What are STDERR and STDIN and STDOUT connected to in a PCP?
In a CGI environment, STDERR points to the server error log file. You
can take this to your advantage by outputting debug messages, and then
checking the log file later on.
Both STDIN and STDOUT point to the browser. In actuality, STDIN
actualls points to the server which interprets the client (or
browser's) request and information, and sends that to the script.
In order to catch errors, you can "dupe" STDERR to STDOUT early on in
your script (after outputting the valid HTTP headers):
open (STDERR, ">&STDOUT");
This redirects all of the error messages to STDOUT (i.e the browser).
http://www.perl.com/pub/a/doc/FAQs/cgi/perl-cgi-faq.html
-------------->
$stderr.puts "my error msg:"
puts this string to the /var/log/httpd/error_log
but
$stderr=$stdout
does not seem to redirect errors to the browser. How can I do this in
ruby?
what about "stack backtraces" do they show up in the error_log file?
message and stack backtrace presented to you in the browser window when
the error occurs. If you can configure your server that way, you'll
find that debugging goes much faster"
I have found this site for perl cgi which seems relevant, but can't
find the ruby cgi info
----------->
Q4.4: What are STDERR and STDIN and STDOUT connected to in a PCP?
In a CGI environment, STDERR points to the server error log file. You
can take this to your advantage by outputting debug messages, and then
checking the log file later on.
Both STDIN and STDOUT point to the browser. In actuality, STDIN
actualls points to the server which interprets the client (or
browser's) request and information, and sends that to the script.
In order to catch errors, you can "dupe" STDERR to STDOUT early on in
your script (after outputting the valid HTTP headers):
open (STDERR, ">&STDOUT");
This redirects all of the error messages to STDOUT (i.e the browser).
http://www.perl.com/pub/a/doc/FAQs/cgi/perl-cgi-faq.html
-------------->
$stderr.puts "my error msg:"
puts this string to the /var/log/httpd/error_log
but
$stderr=$stdout
does not seem to redirect errors to the browser. How can I do this in
ruby?
what about "stack backtraces" do they show up in the error_log file?