Sha256: 630164bfb515f1c0d99366e7d87ff1280b6c8276f2ba98c220a9a781325f800d

Contents?: true

Size: 1.34 KB

Versions: 10

Compression:

Stored size: 1.34 KB

Contents

module NewRelic
  module Agent
    module Configuration
      class EnvironmentSource < DottedHash
        def initialize
          string_map = {
            'NRCONFIG'              => :config_path,
            'NEW_RELIC_LICENSE_KEY' => :license_key,
            'NEWRELIC_LICENSE_KEY'  => :license_key,
            'NEW_RELIC_APP_NAME'    => :app_name,
            'NEWRELIC_APP_NAME'     => :app_name,
            'NEW_RELIC_DISPATCHER'  => :dispatcher,
            'NEWRELIC_DISPATCHER'   => :dispatcher,
            'NEW_RELIC_FRAMEWORK'   => :framework,
            'NEWRELIC_FRAMEWORK'    => :framework
          }.each do |key, val|
            self[val] = ENV[key] if ENV[key]
          end

          boolean_map = {
            'NEWRELIC_ENABLE' => :agent_enabled
          }.each do |key, val|
            if ENV[key].to_s =~ /false|off|no/i
              self[val] = false
            elsif ENV[key] != nil
              self[val] = true
            end
          end

          if ENV['NEW_RELIC_LOG']
            if ENV['NEW_RELIC_LOG'].upcase == 'STDOUT'
              self[:log_file_path] = self[:log_file_name] = 'STDOUT'
            else
              self[:log_file_path] = File.dirname(ENV['NEW_RELIC_LOG'])
              self[:log_file_name] = File.basename(ENV['NEW_RELIC_LOG'])
            end
          end
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
newrelic_rpm-3.5.2.17 lib/new_relic/agent/configuration/environment_source.rb
newrelic_rpm-3.5.1.14 lib/new_relic/agent/configuration/environment_source.rb
newrelic_rpm-3.5.1.14.beta lib/new_relic/agent/configuration/environment_source.rb
newrelic_rpm-3.5.1.beta1 lib/new_relic/agent/configuration/environment_source.rb
newrelic_rpm-3.5.0.1 lib/new_relic/agent/configuration/environment_source.rb
newrelic_rpm-3.5.1.alpha lib/new_relic/agent/configuration/environment_source.rb
newrelic_rpm-3.5.0 lib/new_relic/agent/configuration/environment_source.rb
newrelic_rpm-3.4.2.1 lib/new_relic/agent/configuration/environment_source.rb
newrelic_rpm-3.4.2 lib/new_relic/agent/configuration/environment_source.rb
newrelic_rpm-3.4.2.beta1 lib/new_relic/agent/configuration/environment_source.rb