0.01
No commit activity in last 3 years
No release in over 3 years
GELF logging for Sidekiq
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

>= 1.4
 Project Readme

sidekiq-gelf

Enables Sidekiq logging to a GELF-supported server, such as Graylog2.

Usage

This will inject the logger as middleware into the Sidekiq server. Add it inside of your Sidekiq.configure_server block.

Sidekiq.configure_server do |config|
  # Adds the GELF logger as middleware in Sidekiq in order
  # to include important logging information.
  # These arguments are passed through to gelf-rb.
  Sidekiq::Logging::GELF.hook!('127.0.0.1', 12201, 'LAN', facility: "my-application")
end

Note: by default, normal logging is left as-is. If you wish to log only to the GELF input, you can do:

Sidekiq.configure_server do |config|
  config.server_middleware do |chain|
    chain.remove Sidekiq::Middleware::Server::Logging
  end
end