Re: error_log and get/post vars
[email protected] Wed, 1 Dec 2004 16:59:51 -0600
| Newsgroups | gmane.comp.apache.mod-ruby |
|---|---|
| Message-ID | <[email protected]> |
I added an ErrorDocument directive to my mod_ruby setup in
apache2.conf:
<Location /ruby>
ErrorDocument 500 /ruby/error_500.rb
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance
</Location>
And in the error_500.rb page, this code:
r = Apache.request
r.content_type = "text/plain"
r.send_http_header
print "Ruby Error: ",r.prev.uri,"\n\n"
print r.prev.error_message
These guys had a lot of helpful info for starting out:
http://www.zytrax.com/tech/lang/ruby/
Hope that helps.
On Wed, Dec 01, 2004 at 12:11:00PM -0800, the entity known as [email protected] wrote:
> On Wed, Dec 01, 2004 at 08:06:30PM +0100, dodo <[email protected]> wrote:
> >
> > Hi,
> > First of all, I'd like to compliment u guys on the software.
> > Its a great and required step towards enpowering ruby.
> >
> > I have 2 questions.
> > Is there any way to redirect error output to the http output?
> > (like PHP does).
>
> You can do something like this:
>
> r = Apache.request
> puts r.prev.error_message
>
> Put that into a script that is executed when your server returns
> a 500 error.
>