Sha256: 6d944aa78186685b9c5e3dd10240f899961863de29219878b856843492c1f90d

Contents?: true

Size: 578 Bytes

Versions: 2

Compression:

Stored size: 578 Bytes

Contents

require 'resque/failure/base'
require 'restash/conf'

module Resque
  module Failure
    class Logstash < Base

      def save
        begin
          Restash::Conf.logger.fatal exception: exception.to_s,
                                     failure_line: exception.backtrace[0],
                                     worker: worker.to_s,
                                     queue: queue,
                                     payload: payload
        rescue => e
          puts "Failed to send to logstash: #{e.message}\n#{e.backtrace}"
        end

      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
restash-0.2.1 lib/resque/failure/logstash.rb
restash-0.2.0 lib/resque/failure/logstash.rb