lib/sidekiq/logstash.rb in sidekiq-logstash-3.0.0 vs lib/sidekiq/logstash.rb in sidekiq-logstash-3.1.0
- old
+ new
@@ -2,11 +2,10 @@
require 'sidekiq/logstash/configuration'
require 'sidekiq/logstash/version'
require 'sidekiq/logging/logstash_formatter'
require 'sidekiq/logging/argument_filter'
-require 'sidekiq/logstash_job_logger'
module Sidekiq
# Main level module for Sidekiq::Logstash.
# Provides integration between Sidekiq and Logstash by changing the way
# Sidekiq jobs are logged.
@@ -20,9 +19,11 @@
end
def self.setup(_opts = {})
# Calls Sidekiq.configure_server to inject logics
Sidekiq.configure_server do |config|
+ require 'sidekiq/logstash_job_logger'
+
# Remove default, noisy error handler,
# unless LogStash.configuration.keep_default_error_handler is set to true
unless configuration.keep_default_error_handler
config.error_handlers.delete(Sidekiq::Config::ERROR_HANDLER)
# Insert a no-op error handler to prevent Sidekiq from logging to STDOUT