scoutapp / scout_apm_ruby

ScoutAPM Ruby Agent. Supports Rails, Sinatra, Grape, Rack, and many other frameworks

Home Page:https://scoutapm.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Scout insists on logging to stdout when de-activated

jrochkind opened this issue · comments

We don't run scout in our staging environment. So we don't have it configured, no key, etc.

Even with SCOUT_MONITOR=false, it seems to be wanting to write these lines:

[Scout] [09/08/21 11:13:28 -0400 run.7505 (4)] INFO : Scout Agent [4.1.2] Initialized
[Scout] [09/08/21 11:13:28 -0400 run.7505 (4)] INFO : Not Loading Instruments
[Scout] [09/08/21 11:13:28 -0400 run.7505 (4)] INFO : Scout Agent [4.1.2] Installed
[Scout] [09/08/21 11:13:28 -0400 run.7505 (4)] INFO : Monitoring isn't enabled for the [production] environment.

(yes, our staging environment is still Rails production environment, as is common).

We run on heroku -- heroku does redirect all logging to stdout, so not sure if scout is actually insisting on logging to stdout, or is logging to Rails log which heroku makes stdout. But I think it may actually be insisting on logging these lines to stdout? https://github.com/scoutapp/scout_apm_ruby/blob/master/lib/scout_apm/agent_context.rb#L258

In any case, for us, this means for instance that every time we do heroku run rake ..., those four lines are the first four lines of console output. Which is pretty annoying.

Is there any way to actually tell Scout, no, really, we don't want you, we don't even want you to log, don't do it. Should/could there be?

@jrochkind Apologies for the delayed response. In order to completely silence scout's logging, set log_level: error in your config, or SCOUT_LOG_LEVEL=error via the environment variables.

Setting monitor: false will prevent monitoring/reporting, but doesn't completely prevent the startup of Scout, so it needs to be combined with log_level at the moment.