Pregunta

I have installed NewRelic on my Heroku app, but I would like to turn it off (or at least not see logs) when I run a rake task with heroku run rake xxx - it produces so much of its own output, that the results of rake tasks are obscured.

Wondering if there is some way to do this through the NewRelic config file, etc.

This question here suggests that it addresses the problem, but I'm fine leaving the New Relic settings as is for the app, just not for rake, console and other command line tasks where I might be expecting to read through my own "puts" output etc.

¿Fue útil?

Solución

Edit your Rakefile in the root of your Rails app, and add the following:

ENV['NEW_RELIC_AGENT_ENABLED'] = 'false'

NewRelic agent will respect this environment variable, and setting it within the Rakefile will cause it to be set for all rake tasks, before your app or newrelic agent loads.

Otros consejos

Accurate property name is NEW_RELIC_AGENT_ENABLED. So you should put such line into your Rakefile:

ENV['NEW_RELIC_AGENT_ENABLED'] = 'false'

PS Thanks Winfield!

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top