Class: LogRaider::Interceptor
- Inherits:
-
Object
- Object
- LogRaider::Interceptor
- Defined in:
- lib/log_raider.rb
Instance Method Summary collapse
-
#initialize ⇒ Interceptor
constructor
A new instance of Interceptor.
- #intercept! ⇒ Object
Constructor Details
#initialize ⇒ Interceptor
Returns a new instance of Interceptor.
5 6 7 |
# File 'lib/log_raider.rb', line 5 def initialize @real_logger = Rails.logger end |
Instance Method Details
#intercept! ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/log_raider.rb', line 9 def intercept! @real_logger.class_eval do def error_with_newrelic_reporting() return_value = error_without_newrelic_reporting() NewRelic::Agent.notice_error(Exception.new("From Rails error log: #{}")) return_value end alias_method :error_without_newrelic_reporting, :error alias_method :error, :error_with_newrelic_reporting end end |