Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

production.log empty on Rails 4 / Capistrano / Passenger / Nginx server (digital ocean)

I have set up a rails 4 server on Ubuntu 12.04 using Capistrano, Nginx, Passenger, Postgres, Redis/Resque

Everything is working great, except that the production.log file is always empty.

I have tried a variety of configuration changes in production.rb to no avail.

It's definitely not a permissions issue, as the permissions on both the log dir and each of the logs are wide open (777)

Can anyone hep me figure out how to get basic logging working?

like image 450
Caleb Avatar asked Feb 10 '14 06:02

Caleb


3 Answers

The culprit was Heroku's rails_12factor gem

Removing that gem from the Gemfile, now the logs are working as expected.

# group :production do
#   gem 'rails_12factor'
# end
like image 51
Caleb Avatar answered Nov 08 '22 16:11

Caleb


To clarify, the rails_12factor gem was responsible, but that's only because it includes rails_stdout_logging, which is the real culprit, however, due to it's intended behavior to "ensure that your logs will be sent to standard out."

like image 7
austinjalexander Avatar answered Nov 08 '22 16:11

austinjalexander


Check with the log levels in production.rb file, config.log_level = :debug will display it's errors. Also make sure the server is running production mode, in case you have not made any changes any configuration files for rails env, production mode is by default.

like image 2
Bijendra Avatar answered Nov 08 '22 15:11

Bijendra