Using oink gem with heroku

后端 未结 7 2177
猫巷女王i
猫巷女王i 2020-12-28 18:01

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:

oin         


        
7条回答
  •  难免孤独
    2020-12-28 18:37

    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

提交回复
热议问题