Sha256: 7e68507c130b01167aabb72e11920fd9d1a90610e1bb8eae504aff6923a549a7
Contents?: true
Size: 1.46 KB
Versions: 2
Compression:
Stored size: 1.46 KB
Contents
require 'bugsnag' require 'bugsnag/delivery' require 'bugsnag/delivery/fluent/version' require 'fluent-logger' module Bugsnag module FluentConfiguration def self.included(klass) klass.class_eval do attr_accessor :fluent_tag_prefix attr_accessor :fluent_host attr_accessor :fluent_port end Bugsnag.configuration.fluent_tag_prefix = 'bugsnag' Bugsnag.configuration.fluent_host = 'localhost' Bugsnag.configuration.fluent_port = 24224 end end class Configuration include FluentConfiguration end module Delivery class Fluent def self.deliver(url, body, configuration, options = {}) begin logger = ::Fluent::Logger::FluentLogger.new( configuration.fluent_tag_prefix, :host => configuration.fluent_host, :port => configuration.fluent_port ) if logger.post('deliver', { :url => url, :body => body }) configuration.debug("Notification to #{url} finished, payload was #{body}") else configuration.warn("Notification to #{url} failed, #{logger.last_error}") end rescue StandardError => e raise if e.class.to_s == "RSpec::Expectations::ExpectationNotMetError" configuration.warn("Notification to #{url} failed, #{e.inspect}") configuration.warn(e.backtrace) end end end end end Bugsnag::Delivery.register(:fluent, Bugsnag::Delivery::Fluent)
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
bugsnag-delivery-fluent-0.2.1 | lib/bugsnag/delivery/fluent.rb |
bugsnag-delivery-fluent-0.2.0 | lib/bugsnag/delivery/fluent.rb |