Class: RailsRiemannMiddleware::ExceptionNotification
- Inherits:
-
Object
- Object
- RailsRiemannMiddleware::ExceptionNotification
- Defined in:
- lib/rails_riemann_middleware/exception_notification.rb
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#event ⇒ Object
readonly
Returns the value of attribute event.
-
#exception ⇒ Object
readonly
Returns the value of attribute exception.
Instance Method Summary collapse
-
#initialize(event, env, exception) ⇒ ExceptionNotification
constructor
A new instance of ExceptionNotification.
- #message ⇒ Object
- #send ⇒ Object
Constructor Details
#initialize(event, env, exception) ⇒ ExceptionNotification
Returns a new instance of ExceptionNotification.
6 7 8 |
# File 'lib/rails_riemann_middleware/exception_notification.rb', line 6 def initialize(event, env, exception) @event, @env, @exception = event, env, exception end |
Instance Attribute Details
#env ⇒ Object (readonly)
Returns the value of attribute env.
4 5 6 |
# File 'lib/rails_riemann_middleware/exception_notification.rb', line 4 def env @env end |
#event ⇒ Object (readonly)
Returns the value of attribute event.
4 5 6 |
# File 'lib/rails_riemann_middleware/exception_notification.rb', line 4 def event @event end |
#exception ⇒ Object (readonly)
Returns the value of attribute exception.
4 5 6 |
# File 'lib/rails_riemann_middleware/exception_notification.rb', line 4 def exception @exception end |
Instance Method Details
#message ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/rails_riemann_middleware/exception_notification.rb', line 14 def msg = { :host => env['HTTP_HOST'], :service => "#{event.app_prefix} exception".strip, :state => 'error', :description => backtrace, :tags => ["exception"] } # ap msg msg end |
#send ⇒ Object
10 11 12 |
# File 'lib/rails_riemann_middleware/exception_notification.rb', line 10 def send event << end |