views:

5

answers:

0

I'm using a shared host to serve a rails app using fcgi. (Yes, it's old... passenger would be nice but it's not an option here.) Apparently fastcgi is logging errors to a serverwide log. I guess I need to close stdout/stderr and reopen them in my own location; how do I do this?

Here's my dispatch.fcgi file. It claims that the log should be written inside the log directory of my rails root, but that doesn't work, and providing an argument to the process! command also fails.

#!/usr/bin/ruby
#
# You may specify the path to the FastCGI crash log (a log of unhandled
# exceptions which forced the FastCGI instance to exit, great for debugging)
# and the number of requests to process before running garbage collection.
#
# By default, the FastCGI crash log is RAILS_ROOT/log/fastcgi.crash.log
# and the GC period is nil (turned off).  A reasonable number of requests
# could range from 10-100 depending on the memory footprint of your app.
#
# Example:
#   # Default log path, normal GC behavior.
#   RailsFCGIHandler.process!
#
#   # Default log path, 50 requests between GC.
#   RailsFCGIHandler.process! nil, 50
#
#   # Custom log path, normal GC behavior.
#   RailsFCGIHandler.process! '/var/log/myapp_fcgi_crash.log'
#
require File.dirname(__FILE__) + "/../config/environment"
require 'fcgi_handler'

## Commented out by scripts.mit.edu autoinstaller
## RailsFCGIHandler.process!

## Added by scripts.mit.edu autoinstaller to reload when app code changes
Thread.abort_on_exception = true

t1 = Thread.new do
   RailsFCGIHandler.process!
end

TIA