June 17, 2009

Redirect Stdout and Stderr to Log in Passenger

Filed under: Ruby & Rails — ciddennis @ 2:40 pm

I recently moved my server to use passenger and found that while doing development I lost my standard out and error. After some work I found if I add this to the top of my environments.rb file all my standard out and error are put in file in the rails root / logs directory….

if ENV["TMPDIR"] && ENV["TMPDIR"].index("passenger")
std_out = + "/log/stdout.log","a")
std_err = + "/log/stderr.log","a")


Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Blog at

%d bloggers like this: