Skip to content

Commit

Permalink
Fix ext-newrelic always printing info log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
dzuelke committed Nov 20, 2020
1 parent 92584aa commit 00d43ad
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -12,6 +12,10 @@
- Install Composer using platform installer [David Zuelke]
- Do not output download progress during `composer install` [David Zuelke]

### FIX

- ext-newrelic prints info messages during startup regardless of `NEW_RELIC_LOG_LEVEL` [David Zuelke]

## v183 (2020-11-13)

### ADD
Expand Down
Expand Up @@ -71,7 +71,7 @@ fi
EOF

# gets sourced on dyno boot
cat > ${OUT_PREFIX}/bin/profile.newrelic.sh <<'EOF'
cat >> ${OUT_PREFIX}/bin/profile.newrelic.sh <<'EOF'
# The daemon is a started in foreground mode so it will not daemonize
# (i.e. disassociate from the controlling TTY and disappear into the
# background).
Expand Down
12 changes: 11 additions & 1 deletion test/spec/newrelic_spec.rb
Expand Up @@ -60,7 +60,17 @@
end

['heroku-php-apache2', 'heroku-php-nginx'].each do |script|
next if mode == "with default NEW_RELIC_LOG_LEVEL" # without log level info, we will not see the messages we're using to test the behavior
if mode == "with default NEW_RELIC_LOG_LEVEL"
# without log level info, we will not see the messages we're using to test any behavior
# but we need to assert that no info is printed at all in this case
it "does not output info messages during startup with #{script}" do
out = @app.run("#{script} -F conf/fpm.include.broken") # prevent FPM from starting up using an invalid config, that way we don't have to wrap the server start in a `timeout` call

expect(out).not_to match(/New Relic PHP Agent globally disabled/) # this message should not occur if defaults are applied correctly even at build time
expect(out).not_to match(/New Relic daemon/) # this message should not occur if defaults are applied correctly even at build time
end
next # the other tests do not apply to this case since the log level isn't sufficient to assert anything
end
it "launches newrelic-daemon, but not the extension, during boot preparations, with #{script}" do
out = @app.run("#{script} -F conf/fpm.include.broken") # prevent FPM from starting up using an invalid config, that way we don't have to wrap the server start in a `timeout` call

Expand Down

0 comments on commit 00d43ad

Please sign in to comment.