-
Notifications
You must be signed in to change notification settings - Fork 786
CanCan breaks rails logger on Heroku #511
Comments
Thanks for this. I tried your suggestion on our heroku app and it started logging everything again - although the log also included all the sql queries etc. After a bit of googling, I found this thread: http://groups.google.com/group/heroku/browse_thread/thread/119c52ba08d173b4 After updating my production.rb with: it started logging w/o the sql etc - much better. Turns out you dont need to disable the plugin by adding vendor/plugins/rails_log_stdout if you use the config settings above. So - I think this is more of an heroku issue than cancan... |
i agree. this is a heroku issue, and quite annoying that such a basic thing doesn't work well. |
Hi guys, 2012-01-02T10:11:34+00:00 app[web.2]: /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.1/lib/rails/rack/log_tailer.rb:8:in 2012-01-02T10:11:36+00:00 heroku[web.2]: Process exited I am clueless here. Any idea? |
I was having this issue as well and adding
fixed my problem. I have not tried it but I imagine you could change it to respect the heroku environment variable as well by doing something like this:
@heroku any chance you all could look into this particular issue and potentially update the rails_log_stdout plugin? |
I was curious what CanCan would be doing to the Rails logger. I didn't find any references to Rails.logger or logger anywhere. In any event, this does sound like an issue with how Heroku handles logging rather than with CanCan. I'm going to close, but if there's disagreement let me know and we can re-open and discuss. |
this is (was) a bug with heroku. simply adding the following lines to application.rb caused logging to stop working: module MyModule |
When cancan is installed on a rails 3 app deployed on Heroku's new cedar stack, calling logger.error(), logger.info(), etc doesn't write anything to the log file.
I've been in touch with their support, and here what they say:
To make logging work we inject a plugin that redirects logger input to STDOUT.
https://github.com/ddollar/rails_log_stdout
Some gems interfere with that if they make changes to the default rails logger. I had some free time today, so I went ahead an debugged this. The two gems that are causing problems are 'cancan' and 'simple-navigation'.
There is a way to work around this if you want to keep those gems. You can disable the plugin by creating a vendor/plugins/rails_log_stdout dir in your application, and add a dummy file to it (like a .gitignore) so the directory will end up in git. This will stop this plugin being installed, so you can set the logger in production.rb to log to STDOUT yourself:
config.logger = Logger.new(STDOUT)
config.log_level = :info
Please let me know if this doesn't work for you.
The text was updated successfully, but these errors were encountered: