my rails server seems like it is logging everything twice, not sure what is going on here, what should I do to investigate this ?
In my case this was caused by the rails_12factor
gem. This gem adds the rails_stdout_logging
gem which sends the logs to standard output. This can be useful in a production environment but not in development when Rails already does it by default.
https://github.com/heroku/rails_12factor#rails-4-logging
The solution is to only add this gem in production:
gem 'rails_12factor', group: :production
I had success with this in development.rb
:
config.logger = ActiveSupport::Logger.new('/dev/null')
Have a look at this issue
Try adding the following code to you config/application.rb
if Rails.env.development?
# Don't log to STDOUT, by default rails s will handle it
config.logger = Logger.new('/dev/null')
else
# Don't log to file, sending everything to unicorn file.
config.logger = Logger.new(STDOUT)
end
Do you have your logger set to anything in either config/application.rb or config/environments/development.rb?
If nothing, try adding this line to config/environments/development.rb:
config.logger = Logger.new('/dev/null')