I've installed oink gem for monitoring the memory usage of my rails application. In order to see oink report I need to run this command in the terminal:
oink --threshold=75 /log/*
When I run it on my machine it shows the report for the development environment. The thing is that I'm more interested on seeing the report for my production environment. My app is hosted on heroku, is there a way I could run oink's terminal commands for the heroku's production environment?
Thanks
I got oink working on heroku doing this:
You have to change your log_level to info for the oink logs to show up:
heroku config:add LOG_LEVEL=info
Add oink middleware to production.rb with a custom stdout logger
config.middleware.use( Oink::Middleware, :logger => Hodel3000CompliantLogger.new(STDOUT))
When you want to parse your logs, tail them to a local file, then remove heroku's prefix and filter to only the oink lines.
heroku logs --tail > log/production.log
cat log/production.log | cut -c 46- | grep 'Oink\|Memory\|Instantiation' > log/production-oink.log
Then run oink on your new local log
oink --threshold=0 log/production-oink.log
You could also download logs from logentries or paperclip
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With