Class: Binnacle::Trap::ExceptionEvent
- Defined in:
- lib/binnacle/trap/exception_event.rb
Instance Attribute Summary collapse
-
#backtrace ⇒ Object
readonly
Returns the value of attribute backtrace.
-
#component ⇒ Object
readonly
Returns the value of attribute component.
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#exception ⇒ Object
readonly
Returns the value of attribute exception.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#module ⇒ Object
readonly
Returns the value of attribute module.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
Attributes inherited from Event
#channel_id, #client_event_time, #client_id, #environment, #event_name, #event_time, #ip_address, #json, #log_level, #session_id, #tags
Attributes inherited from Resource
Instance Method Summary collapse
-
#initialize(exception, env) ⇒ ExceptionEvent
constructor
A new instance of ExceptionEvent.
Methods inherited from Event
#configure, #configure_from_logging_progname, events, from_hash, recents, #route, route, #timestamp=, #to_json
Methods inherited from Resource
Constructor Details
#initialize(exception, env) ⇒ ExceptionEvent
Returns a new instance of ExceptionEvent.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/binnacle/trap/exception_event.rb', line 26 def initialize(exception, env) @exception = unwrap_exception(exception) @env = env if env["action_dispatch.request.parameters"] != nil @component = env['action_dispatch.request.parameters'][:controller] || nil @method = env['action_dispatch.request.parameters'][:action] || nil @module = env['action_dispatch.request.parameters'][:module] || nil end @request = ::Rack::Request.new(env) extract_event_name extract_session_id extract_client_id extract_backtrace self.log_level = "EXCEPTION" self. = [] build_json_payload configure( Binnacle.configuration.error_channel, self.event_name, self.client_id, self.session_id, self.log_level, nil, self., self.json ) end |
Instance Attribute Details
#backtrace ⇒ Object (readonly)
Returns the value of attribute backtrace.
24 25 26 |
# File 'lib/binnacle/trap/exception_event.rb', line 24 def backtrace @backtrace end |
#component ⇒ Object (readonly)
Returns the value of attribute component.
21 22 23 |
# File 'lib/binnacle/trap/exception_event.rb', line 21 def component @component end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
19 20 21 |
# File 'lib/binnacle/trap/exception_event.rb', line 19 def env @env end |
#exception ⇒ Object (readonly)
Returns the value of attribute exception.
18 19 20 |
# File 'lib/binnacle/trap/exception_event.rb', line 18 def exception @exception end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
22 23 24 |
# File 'lib/binnacle/trap/exception_event.rb', line 22 def method @method end |
#module ⇒ Object (readonly)
Returns the value of attribute module.
23 24 25 |
# File 'lib/binnacle/trap/exception_event.rb', line 23 def module @module end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
20 21 22 |
# File 'lib/binnacle/trap/exception_event.rb', line 20 def request @request end |