Class: Raven::Configuration
- Inherits:
-
Object
- Object
- Raven::Configuration
- Defined in:
- lib/raven/configuration.rb
Constant Summary collapse
- IGNORE_DEFAULT =
['ActiveRecord::RecordNotFound', 'ActionController::RoutingError', 'ActionController::InvalidAuthenticityToken', 'CGI::Session::CookieStore::TamperedWithCookie', 'ActionController::UnknownAction', 'AbstractController::ActionNotFound', 'Mongoid::Errors::DocumentNotFound']
Instance Attribute Summary collapse
-
#context_lines ⇒ Object
Number of lines of code context to capture, or nil for none.
-
#current_environment ⇒ Object
Returns the value of attribute current_environment.
-
#encoding ⇒ Object
Encoding type for event bodies.
-
#environments ⇒ Object
Whitelist of environments that will send notifications to Sentry.
-
#excluded_exceptions ⇒ Object
Which exceptions should never be sent.
-
#host ⇒ Object
Returns the value of attribute host.
-
#http_adapter ⇒ Object
The Faraday adapter to be used.
-
#logger ⇒ Object
Logger to use internally.
-
#open_timeout ⇒ Object
Timeout waiting for the connection to open in seconds.
-
#path ⇒ Object
Returns the value of attribute path.
-
#port ⇒ Object
Returns the value of attribute port.
-
#processors ⇒ Object
Processors to run on data before sending upstream.
-
#project_id ⇒ Object
Project ID number to send to the Sentry server.
-
#project_root ⇒ Object
Project directory root.
-
#public_key ⇒ Object
Public key for authentication with the Sentry server.
-
#scheme ⇒ Object
Accessors for the component parts of the DSN.
-
#secret_key ⇒ Object
Secret key for authentication with the Sentry server.
-
#send_modules ⇒ Object
Include module versions in reports?.
-
#server ⇒ Object
Simple server string (setter provided below).
-
#server_name ⇒ Object
Returns the value of attribute server_name.
-
#ssl_verification ⇒ Object
Should the SSL certificate of the server be verified?.
-
#timeout ⇒ Object
Timeout when waiting for the server to return data in seconds.
Instance Method Summary collapse
-
#[](option) ⇒ Object
Allows config options to be read like a hash.
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #send_in_current_environment? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/raven/configuration.rb', line 70 def initialize self.server = ENV['SENTRY_DSN'] if ENV['SENTRY_DSN'] @context_lines = 3 self.current_environment = ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'default' self.send_modules = true self.excluded_exceptions = IGNORE_DEFAULT self.processors = [Raven::Processor::SanitizeData] self.ssl_verification = true self.encoding = 'json' self.timeout = 1 self.open_timeout = 1 end |
Instance Attribute Details
#context_lines ⇒ Object
Number of lines of code context to capture, or nil for none
32 33 34 |
# File 'lib/raven/configuration.rb', line 32 def context_lines @context_lines end |
#current_environment ⇒ Object
Returns the value of attribute current_environment.
55 56 57 |
# File 'lib/raven/configuration.rb', line 55 def current_environment @current_environment end |
#encoding ⇒ Object
Encoding type for event bodies
26 27 28 |
# File 'lib/raven/configuration.rb', line 26 def encoding @encoding end |
#environments ⇒ Object
Whitelist of environments that will send notifications to Sentry
35 36 37 |
# File 'lib/raven/configuration.rb', line 35 def environments @environments end |
#excluded_exceptions ⇒ Object
Which exceptions should never be sent
41 42 43 |
# File 'lib/raven/configuration.rb', line 41 def excluded_exceptions @excluded_exceptions end |
#host ⇒ Object
Returns the value of attribute host.
15 16 17 |
# File 'lib/raven/configuration.rb', line 15 def host @host end |
#http_adapter ⇒ Object
The Faraday adapter to be used. Will default to Net::HTTP when not set.
58 59 60 |
# File 'lib/raven/configuration.rb', line 58 def http_adapter @http_adapter end |
#logger ⇒ Object
Logger to use internally
29 30 31 |
# File 'lib/raven/configuration.rb', line 29 def logger @logger end |
#open_timeout ⇒ Object
Timeout waiting for the connection to open in seconds
50 51 52 |
# File 'lib/raven/configuration.rb', line 50 def open_timeout @open_timeout end |
#path ⇒ Object
Returns the value of attribute path.
17 18 19 |
# File 'lib/raven/configuration.rb', line 17 def path @path end |
#port ⇒ Object
Returns the value of attribute port.
16 17 18 |
# File 'lib/raven/configuration.rb', line 16 def port @port end |
#processors ⇒ Object
Processors to run on data before sending upstream
44 45 46 |
# File 'lib/raven/configuration.rb', line 44 def processors @processors end |
#project_id ⇒ Object
Project ID number to send to the Sentry server
20 21 22 |
# File 'lib/raven/configuration.rb', line 20 def project_id @project_id end |
#project_root ⇒ Object
Project directory root
23 24 25 |
# File 'lib/raven/configuration.rb', line 23 def project_root @project_root end |
#public_key ⇒ Object
Public key for authentication with the Sentry server
8 9 10 |
# File 'lib/raven/configuration.rb', line 8 def public_key @public_key end |
#scheme ⇒ Object
Accessors for the component parts of the DSN
14 15 16 |
# File 'lib/raven/configuration.rb', line 14 def scheme @scheme end |
#secret_key ⇒ Object
Secret key for authentication with the Sentry server
11 12 13 |
# File 'lib/raven/configuration.rb', line 11 def secret_key @secret_key end |
#send_modules ⇒ Object
Include module versions in reports?
38 39 40 |
# File 'lib/raven/configuration.rb', line 38 def send_modules @send_modules end |
#server ⇒ Object
Simple server string (setter provided below)
5 6 7 |
# File 'lib/raven/configuration.rb', line 5 def server @server end |
#server_name ⇒ Object
Returns the value of attribute server_name.
60 61 62 |
# File 'lib/raven/configuration.rb', line 60 def server_name @server_name end |
#ssl_verification ⇒ Object
Should the SSL certificate of the server be verified?
53 54 55 |
# File 'lib/raven/configuration.rb', line 53 def ssl_verification @ssl_verification end |
#timeout ⇒ Object
Timeout when waiting for the server to return data in seconds
47 48 49 |
# File 'lib/raven/configuration.rb', line 47 def timeout @timeout end |
Instance Method Details
#[](option) ⇒ Object
Allows config options to be read like a hash
115 116 117 |
# File 'lib/raven/configuration.rb', line 115 def [](option) send(option) end |
#send_in_current_environment? ⇒ Boolean
123 124 125 126 127 128 129 |
# File 'lib/raven/configuration.rb', line 123 def send_in_current_environment? if environments environments.include?(current_environment) else !%w[test cucumber development].include?(current_environment) end end |