I've deployed a ruby on rails 4.0.3 application to a server that I've configured with the following likely relevant software:
- Ubuntu 12.04.4 x64 server
- Phusion Passenger 4.0.37
- Apache 2.2.22
- Ruby 2.0.0p353
- Rails 4.0.3 / Capistrano 2.15.5 / Rake 10.1.1
Everything with the app seems to be working properly, with the exception of the rails application logging. My expectation is that everything application-specific should be written to the {Rails.root}/log/production.log file. However, everything seems to be being written to /var/log/apache2/error.log.
Here's an excerpt from the apache error.log to show what I mean:
App 1495 stdout: Started GET "/" for 192.168.1.106 at 2014-03-08 17:26:04 -0500
App 1495 stdout: Processing by HomeController#index as HTML
App 1495 stdout: Rendered home/index.html.erb within layouts/application (0.1ms)
App 1495 stdout: Rendered layouts/_header.html.erb (2.0ms)
App 1495 stdout: Rendered home/_auth.html.erb (0.4ms)
App 1495 stdout: Rendered layouts/_footer.html.erb (0.1ms)
App 1495 stdout: Completed 200 OK in 9ms (Views: 5.8ms | ActiveRecord: 0.0ms)
I find it interesting that the log/production.log even gets created, but nothing is being written to it.
Some things that I've looked into/verified:
- RAILS_ENV=production
- The {Rails.root}/config/environments/production.rb is set to all of the default values
- My apache/passenger setup is mostly default, with the exception of having to add a virtualhost entry for my app, like so:
<VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/apps/myapp/current/public RailsEnv production </VirtualHost>
- Permissions across all of the files in the rails app, appear to be good - and in desperation I tried to grant '777' permission to the log/production.log, to no avail.
I'll be happy to provide any other application configuration information or environment details upon request.