shoryuken icon indicating copy to clipboard operation
shoryuken copied to clipboard

Add the Ability to be Able to Configure the Logger

Open BenMorganMY opened this issue 1 year ago • 2 comments

This PR allows Shoryuken to be able to configure the logger such as:

Shoryuken.logger = Appsignal::Logger.new('shoryuken')
Shoryuken.logger.formatter = Shoryuken::Logging::WithoutTimestamp.new

This provides some feature parity to Sidekiq and helps developers that are using a service like AppSignal get their logs up there.

https://docs.appsignal.com/logging/platforms/integrations/ruby.html#sidekiq-logger

BenMorganMY avatar Jul 25 '24 20:07 BenMorganMY

Just passing by, however, I've been using a custom logger for years with no issue.

You can already configure the Shoryuken logger via the options field.

# disclaimer this is sudo code and untested...
require "logger"

class MyCustomLogger < Logger; end

custom_logger = MyCustomLogger.new("my_custom_logger")

Shoryuken.options[:logger] = custom_logger

Or in the config options hash you can pass in the custom_logger instance.

Shoryuken will now log via your custom logger where you can redefine your implementation.

DanHenton avatar Jul 31 '24 23:07 DanHenton

@DanHenton I believe I began with that and wanted to take it further. I wasn't confident that Shoryuken would stick with the configuration that was set via the options. I wanted a first class option so that the logger never accidentally goes to the default log.

I also needed a log that would be compatible with AppSignal for usage.

BenMorganMY avatar Aug 07 '24 01:08 BenMorganMY

@BenMorganMY @DanHenton I can no longer maintain this project. I updated the README with additional info https://github.com/ruby-shoryuken/shoryuken/commit/946ed1d9bb211c8b3b88cb911df48f9229ba8f45

phstc avatar Oct 29 '24 21:10 phstc

@phstc Thanks for the update.

Appreciate all of your work on this project ❤️

DanHenton avatar Oct 29 '24 21:10 DanHenton

This PR is now marked as stale because it hasn't seen activity for a while. Add a comment or it will be closed soon.

github-actions[bot] avatar Dec 29 '24 02:12 github-actions[bot]

This PR was closed because it hasn't seen activity for a while.

github-actions[bot] avatar Jan 06 '25 02:01 github-actions[bot]

RIP

BenMorganMY avatar Jan 06 '25 17:01 BenMorganMY