Sha256: 8a60fee51b9d167240efc439a420b6ac6fe9b025b48447199dba88eff928ad0d

Contents?: true

Size: 592 Bytes

Versions: 9

Compression:

Stored size: 592 Bytes

Contents

# Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
# or more contributor license agreements. Licensed under the Elastic License;
# you may not use this file except in compliance with the Elastic License.

require 'stud/try'

module LogStash module Helpers
  class LoggableTry < Stud::Try
    def initialize(logger, name)
      @logger = logger
      @name = name
    end

    def log_failure(exception, fail_count, message)
      @logger.warn("Attempt to #{@name} but failed. #{message}", fail_count: fail_count, exception: exception.message)
    end
  end
end end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
logstash-input-elasticsearch-4.20.0 lib/logstash/helpers/loggable_try.rb
logstash-input-elasticsearch-4.19.1 lib/logstash/helpers/loggable_try.rb
logstash-input-elasticsearch-4.19.0 lib/logstash/helpers/loggable_try.rb
logstash-input-elasticsearch-4.18.0 lib/logstash/helpers/loggable_try.rb
logstash-input-elasticsearch-4.17.2 lib/logstash/helpers/loggable_try.rb
logstash-input-elasticsearch-4.17.1 lib/logstash/helpers/loggable_try.rb
logstash-input-elasticsearch-4.17.0 lib/logstash/helpers/loggable_try.rb
logstash-input-elasticsearch-4.16.0 lib/logstash/helpers/loggable_try.rb
logstash-input-elasticsearch-4.15.0 lib/logstash/helpers/loggable_try.rb