lib/new_relic/agent/agent.rb in newrelic_rpm-3.4.2 vs lib/new_relic/agent/agent.rb in newrelic_rpm-3.4.2.1
- old
+ new
@@ -313,10 +313,15 @@
log.info "Dispatcher: #{dispatcher_name}"
end
# Logs the configured application names
def log_app_names
- log.info "Application: #{Agent.config.app_names.join(", ")}"
+ names = Agent.config.app_names
+ if names.respond_to?(:any?) && names.any?
+ log.info "Application: #{names.join(", ")}"
+ else
+ log.error 'Unable to determine application name. Please set the application name in your newrelic.yml or in a NEW_RELIC_APP_NAME environment variable.'
+ end
end
# Connecting in the foreground blocks further startup of the
# agent until we have a connection - useful in cases where
# you're trying to log a very-short-running process and want