简体   繁体   中英

Disable NewRelic logs when running rake task on Heroku

I have NewRelic plugged into my app, and whenever I run a rake task on Heroku I get the following output as part of the logging. There doesn't seem to be anything particularly informative or actionable in it (aside from maybe setting up SSL at some point) so I was wondering what's the best way to disable this from outputting every time I run rake.

** [NewRelic][11/05/13 21:33:14 +0000 bdea8934-129f-424d-8fb8-8496711f2c74 (2)] INFO : Starting the New Relic agent in "production" environment.
** [NewRelic][11/05/13 21:33:14 +0000 bdea8934-129f-424d-8fb8-8496711f2c74 (2)] INFO : To prevent agent startup add a NEWRELIC_ENABLE=false environment variable or modify the "production" section of your newrelic.yml.
** [NewRelic][11/05/13 21:33:14 +0000 bdea8934-129f-424d-8fb8-8496711f2c74 (2)] INFO : Reading configuration from config/newrelic.yml
** [NewRelic][11/05/13 21:33:14 +0000 bdea8934-129f-424d-8fb8-8496711f2c74 (2)] WARN : Agent is configured not to use SSL when communicating with New Relic's servers
** [NewRelic][11/05/13 21:33:14 +0000 bdea8934-129f-424d-8fb8-8496711f2c74 (2)] INFO : Enabling the Request Sampler.
** [NewRelic][11/05/13 21:33:14 +0000 bdea8934-129f-424d-8fb8-8496711f2c74 (2)] INFO : Enabling the Request Sampler.
** [NewRelic][11/05/13 21:33:14 +0000 bdea8934-129f-424d-8fb8-8496711f2c74 (2)] INFO : Environment: production
** [NewRelic][11/05/13 21:33:14 +0000 bdea8934-129f-424d-8fb8-8496711f2c74 (2)] INFO : Dispatcher: thin
** [NewRelic][11/05/13 21:33:14 +0000 bdea8934-129f-424d-8fb8-8496711f2c74 (2)] INFO : Application: quickies
** [NewRelic][11/05/13 21:33:14 +0000 bdea8934-129f-424d-8fb8-8496711f2c74 (2)] INFO : Installing ActiveRecord instrumentation
** [NewRelic][11/05/13 21:33:14 +0000 bdea8934-129f-424d-8fb8-8496711f2c74 (2)] INFO : Installing Net instrumentation
** [NewRelic][11/05/13 21:33:14 +0000 bdea8934-129f-424d-8fb8-8496711f2c74 (2)] INFO : Installing deferred Rack instrumentation
** [NewRelic][11/05/13 21:33:14 +0000 bdea8934-129f-424d-8fb8-8496711f2c74 (2)] INFO : Installing Rails 3 Controller instrumentation
** [NewRelic][11/05/13 21:33:14 +0000 bdea8934-129f-424d-8fb8-8496711f2c74 (2)] INFO : Installing Rails 3.1/3.2 view instrumentation
** [NewRelic][11/05/13 21:33:14 +0000 bdea8934-129f-424d-8fb8-8496711f2c74 (2)] INFO : Installing Rails3 Error instrumentation
** [NewRelic][11/05/13 21:33:14 +0000 bdea8934-129f-424d-8fb8-8496711f2c74 (2)] INFO : Finished instrumentation
** [NewRelic][11/05/13 21:33:16 +0000 bdea8934-129f-424d-8fb8-8496711f2c74 (2)] INFO : Starting Agent shutdown

You could change the New Relic log_level in your newrelic.yml file or via an environment variable (NEW_RELIC_LOG_LEVEL). The levels, in descending order of verbosity, are:

  • debug
  • info
  • warn
  • error
  • fatal

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM