Sha256: 668652076e45db023ddc25f078b1d96db16b48c740e9d838fcf7489da4e442e5

Contents?: true

Size: 623 Bytes

Versions: 5

Compression:

Stored size: 623 Bytes

Contents

# frozen_string_literal: true

module ServiceSkeleton
  module UltravisorLoggerstash
    def logstash_writer
      #:nocov:
      @ultravisor[:logstash_writer].unsafe_instance(wait: false)
      #:nocov:
    end

    # logstash_writer will be nil if the logstash_writer worker is not running
    # Ultravisor's restart policy ensures this will never happen at runtime. But
    # it does happen during startup and shutdown. In this case, we want to skip
    # writing to logstash, not block forever. STDOUT logging will continue.
    def loggerstash_log_message(*args)
      super if !logstash_writer.nil?
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
service_skeleton-2.2.0 lib/service_skeleton/ultravisor_loggerstash.rb
service_skeleton-2.1.0 lib/service_skeleton/ultravisor_loggerstash.rb
service_skeleton-1.0.5 lib/service_skeleton/ultravisor_loggerstash.rb
service_skeleton-2.0.2 lib/service_skeleton/ultravisor_loggerstash.rb
service_skeleton-2.0.1 lib/service_skeleton/ultravisor_loggerstash.rb