title: How to access console (stdout) of a Rails app when starting nginx with Passenger and Rails app?
body: <p>I use Phusion Passenger to run a Rails application. I have a confing in the nginx directory, so when I restart nginx I get my Rails application running. </p>
  
  <p>However, I have some problems with the app, so I would like to look into the console for error output. If I run the Rails application with explicitly <code>passenger start</code> command within the Rails app directory - then no error occurs. </p>
  
  <p>So I need to get live output from the console when the Rails app is running with nginx.</p>
  
  <p>The problem is: no file is going written in my download directory within the Rails public directory (i.e. <code>./public/downloads/...</code>). I write the file using:</p>
  
  <pre><code>open(file_path, 'wb') do |file| 
   ...
   file &lt;&lt; open(url)
   ...
  end
  </code></pre>
  
  <p>If somebody knows why the error could occur when running not with <code>passenger start</code>, but with <code>sudo /opt/nginx/sbin/nginx -s reload</code>, it would be great to understand the cause.</p>
  
  <h1>Update:</h1>
  
  <p>I see it is writing to the <code>log/passenger.3000.log</code>. But is it possible to connect some terminal directly to the app, as passenger is connected?</p>
  
  <h1>Update 2:</h1>
  
  <p>Wrong! The <code>log/passenger.3000.log</code> is going written when I start the application with <code>passenger start</code>. But the <code>log/development.log</code> is the one I searched for. And it is possible to watch the file with either <code>tail -f log/development.log</code> or with <code>watch tail log/development.log</code></p>