Why is Rails not writing to development.log
OK, after much going round in circles, I finally found the culprit.
The rails_12factor
is apparently overwriting config.logger.
See: https://github.com/heroku/rails_stdout_logging/blob/master/lib/rails_stdout_logging/rails3.rb#L7
I removed this gem from the development environment (I really only need it in the deployed environment) and everything is now working.
To put a gem in production only, it needs to be in a gem environment group like this:
# This is override development.log output and should only go in production.
group :production do
gem 'rails_12factor'
end
Thanks @maxd for helping to get me thinking in the right direction.
Add the following line to config/environments/development.rb
config.log_level = :debug
restart server
I think your problem can be caused by the following things:
You set to high log level. Check your
application.rb
andenvironments\*.rb
files:# Set to :debug to see everything in the log. config.log_level = :error
You set custom logging. Check your
application.rb
,environments/*.rb
and all files ininitializers/*.rb
:# Use a different logger for distributed setups. config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
These two steps should help you to investigate problem and fix it.