-
Notifications
You must be signed in to change notification settings - Fork 35
Make compatible with Heroku by adding logs to both Mongo and STDOUT #11
base: master
Are you sure you want to change the base?
Conversation
Thanks, this was helpful. I'm a little surprised there's not more noise about this, I would guess logging is broken for anyone using central logger and heroku without these patches. |
Took a while to get around to this, but thanks for the pull request. I don't believe writing to STDOUT is necessary to see your logs. Wouldn't it be desirable to use the existing channels to see your app log? Let me know if I'm missing something here. Somewhere in app Will show your log statement |
The requirement to write to STDOUT is written in the link you provided... http://devcenter.heroku.com/articles/logging#writing_to_your_log |
I needed this back when I was on Heroku. Now I no longer need it, but a number of people have found it useful. |
@reedlaw Were you using rails? The mongo logger still logs to the app log, which should be viewable using heroku logs --source app @betelgeuse Logging to STDOUT is not required to see your app logs. The central logger extends BufferedLogger, which still writes to the production log file. That is viewable using the above command. Is there some other use case I should be supporting? |
Yes, I patched central_logger because Heroku support told me that in order for their advanced logging to work the app must output all logs to STDOUT. |
@astupka I think Heroku with the new logging system does not use the production log file any more. I haven't tested verbatim central_logger on Heroku recently but I think I subscribed here because I needed the patches to get it working. |
Yes.... still critical to do the following for Heroku as pointed out in redlaw's 808e05f patch : mkdir vendor/plugins/rails_log_stdout had been working on this issue for a few hours until I tried this... worked right away. thanks you reedlaw! |
Central Logger stopped working for me on Heroku about a month ago. I was tearing my hair out until finding this patch from @reedlaw. @astupka, what do you need to merge this pull request? I can make a fresh commit and request if you want. In the meantime, here's a fork with some of the recent pull requests: https://github.com/turadg/central_logger/commits/master |
Update: the vendor/plugins trick was working for me then stopped yesterday. I wrote Heroku support to ask how to stop the injection of their rails_log_stdout and they replied:
Can a feature be added to Central Logger to detect when the logger is borked and reset it accordingly? |
Update: what I thought was central_logger no longer working (due to the error messages) was just confined to
…because I keep my Central Logger password in a config var for security (rather than in source). I don't really need central_logger activated during assets:precompile. Can CL be silenced when in a rake task? I hope these comments are relevant to other people trying to get Heroku and Central Logger working together. Btw, @jamescallmebrent has a commit to make these @reelaw's STDOUT logging happen only |
Late reply. Sorry. I am in the process of adding rails 3.1 support. I will release a new version of the gem in the next few weeks. I need to add tests to this pull request to make sure it doesn't mess with non-heroku deploys. Alex |
@astupka how's this one coming? :) |
Heroku logs require messages to be sent to STDOUT. This patch makes central_logger store logs both in mongodb and output to STDOUT.