Presently I'm running a Rails 3.1.x app atop Heroku Celadon Cedar and it seems that log verbosity is very much lacking. I have set the log level to DEBUG a la heroku config:add LOG_LEVEL=DEBUG --app app_name
, which matched up to their recommendation, however beyond that I cannot seem to pull in the log/* file contents.
Changing from Thin to Unicorn did increase verbosity slightly, but only in web worker requests. I still cannot pull down the db requests and so forth.
What is the best way to maximize log verbosity via the heroku "drain" mechanism so that one can pull all instance logs into one cohesive log?
(Ideally I'd like to include a method to dump this into one of my own log servers as this is just a pain the rear not being able to readily look at specific events and surrounding conditions in time.)
In staging.rb, production.rb or whatever environment you're running, you can insert the following:
I think the ActiveRecord logger object sends all SQL query logs with a DEBUG severity level. You may need to adjust the Rails.logger log level to get those in production too.
Since you are interested in dumping all Rails and Heroku logs to an external service, I can suggest you try the Progstr Logger free add-on. (Disclaimer, I work for Progstr). The add-on has a Ruby gem that will collect all Rails logs (everything that usually ends up in log/*). It will also set up a log drain that will fetch all system-level Heroku logs. In addition you get a cool web UI that lets you easily search for logs and some other nice features.