Sidekiq: Add support for log stash lograge-style

Created on 1 Jul 2016  路  5Comments  路  Source: mperham/sidekiq

I'm in the process of setting up the ELK stack for all our applications to manage log aggregation.
Lograge has been extremely useful to compress rails multi-line log into a single-line JSON log.
It would be great to have the same for Sidekiq, so I'm here asking if there's anything already in place (a setting, a plugin, ...) which will do the job.
If that's not the case, what's the preferred course of actions in this case?

  1. I write an extension/ monkey-patch sidekiq on my application (suggestions would be welcome in this case)
  2. I try to implement and issue a pull request to make it available for everyone (again, direction/suggestions really welcome)
  3. You already know how to do it, so I just wait 馃槃

Thanks,

Mattia

Most helpful comment

As promised: https://github.com/iMacTia/sidekiq-logstash
It's still a WIP and I would like to make it customisable based on input from other developers.
@mperham, I know you're a busy man, but your input would be really much appreciated :)

All 5 comments

Sidekiq.configure_server do |config|
  config.logger.formatter = LogrageFormatter.new
end

Now you provide LogrageFormatter based on the default formatter. I'm not aware of an existing plugin but you are welcome to OSS your solution.

Many thanks, I'll work on it based on the 'default formatter'.
Would you prefer this to be implemented as an additional formatter inside sidekiq gem (PR) or as a standalone plugin-gem?

Standalone. It's small enough that someone can put it in an initializer and customize as necessary.

As promised: https://github.com/iMacTia/sidekiq-logstash
It's still a WIP and I would like to make it customisable based on input from other developers.
@mperham, I know you're a busy man, but your input would be really much appreciated :)

I have no real input but thanks for publishing it; I hope it works well for you and your users.

Was this page helpful?
0 / 5 - 0 ratings