Class: NewRelic::Control::Frameworks::Rails3

Inherits:
Rails show all
Defined in:
lib/new_relic/control/frameworks/rails3.rb

Instance Attribute Summary

Attributes inherited from NewRelic::Control

#local_env

Attributes included from LoggingMethods

#log_file

Instance Method Summary collapse

Methods inherited from Rails

#init_config, #install_developer_mode, #install_episodes, #rails_version

Methods inherited from NewRelic::Control

#agent_enabled?, #app, #init_plugin, #start_agent, #to_s

Methods included from ClassMethods

#instance, #new_instance, #newrelic_root

Methods included from Instrumentation

#_delayed_instrumentation, #add_instrumentation, #install_instrumentation, #install_shim, #load_instrumentation_files, #load_samplers

Methods included from ServerMethods

#api_server, #convert_to_ip_address, #http_connection, #proxy_server, #server, #server_from_host

Methods included from Configuration

#[], #[]=, #apdex_t, #app_names, #capture_params, #developer_mode?, #dispatcher, #dispatcher_instance_id, #episodes_enabled?, #fetch, #license_key, #merge_defaults, #merge_options, #monitor_mode?, #multi_threaded?, #post_size_limit, #send_data_on_exit, #settings, #sync_startup, #use_ssl?, #use_textmate?, #validate_seed, #validate_token, #verify_certificate?

Methods included from LoggingMethods

#log, #log_file_name, #log_path, #setup_log, #should_log?

Methods included from Profiling

#profiling=, #profiling?, #profiling_available?

Instance Method Details

#envObject



7
8
9
# File 'lib/new_relic/control/frameworks/rails3.rb', line 7

def env
  @env ||= ::Rails.env.to_s
end

#log!(msg, level = :info) ⇒ Object



20
21
22
23
24
25
# File 'lib/new_relic/control/frameworks/rails3.rb', line 20

def log!(msg, level=:info)
  return unless should_log?
  logger.send(level, msg)
rescue Exception => e
  super
end

#loggerObject



15
16
17
# File 'lib/new_relic/control/frameworks/rails3.rb', line 15

def logger
  ::Rails.logger
end

#rootObject



11
12
13
# File 'lib/new_relic/control/frameworks/rails3.rb', line 11

def root
  @root ||= Rails.root.to_s
end

#to_stdout(msg) ⇒ Object



27
28
29
30
31
# File 'lib/new_relic/control/frameworks/rails3.rb', line 27

def to_stdout(msg)
  logger.info(msg)
rescue
  super
end

#vendor_rootObject



33
34
35
# File 'lib/new_relic/control/frameworks/rails3.rb', line 33

def vendor_root
  @vendor_root ||= File.join(root,'vendor','rails')
end

#versionObject



37
38
39
# File 'lib/new_relic/control/frameworks/rails3.rb', line 37

def version
  @rails_version ||= NewRelic::VersionNumber.new(::Rails::VERSION::STRING)
end