Class: LogstashRails::TransportBase
- Inherits:
-
Object
- Object
- LogstashRails::TransportBase
- Defined in:
- lib/logstash_rails/transport_base.rb
Overview
base class for transports
Direct Known Subclasses
LogstashRails::Transport::Logfile, LogstashRails::Transport::LogstashTcp, LogstashRails::Transport::LogstashUdp, LogstashRails::Transport::Redis
Instance Method Summary collapse
-
#destroy ⇒ Object
destroy.
-
#initialize(formatter, options) ⇒ TransportBase
constructor
A new instance of TransportBase.
Constructor Details
#initialize(formatter, options) ⇒ TransportBase
Returns a new instance of TransportBase.
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/logstash_rails/transport_base.rb', line 7 def initialize(formatter, ) @events = [:events] || [/.*/] @error_logger = [:logger] @raise_errors = [:raise_errors] || false @formatter = formatter if defined?(Rails) @error_logger ||= Rails.logger end subscribe end |
Instance Method Details
#destroy ⇒ Object
destroy
unsubscribe from ActiveSupport::Notifications
24 25 26 27 28 29 30 |
# File 'lib/logstash_rails/transport_base.rb', line 24 def destroy return unless @subscriptions @subscriptions.each do |subscription| ActiveSupport::Notifications.unsubscribe(subscription) end end |