Open lauer opened 11 months ago
Thanks for reporting this, I'll take a look at it as soon as I have some time.
Phew, this was an "interesting" one. It turns out that this issue is a confluence of two separate problems - neither of which is related to Logcraft. One is that sentry-rails
- for some reason - duplicates the Rails logger stack (https://github.com/getsentry/sentry-ruby/blob/master/sentry-rails/lib/sentry/rails/configuration.rb#L15). The other one is that the logging
gem (which Logcraft is based on) relies on metaprogramming to define its logging methods, hence it cannot be duplicated.
The problem should really be addressed in either of these gems but for now I pushed a workaround into Logcraft.
New version is released with the fix.
So after some debug, I found out, that if you are using Sentry (https://docs.sentry.io/platforms/ruby/guides/rails/configuration/options/) together with this Gem, you will hit some strange logger error in the
broadcast_logger.rb
So the solution is in the Sentry configuration, to set the logger like
config.logger = Sentry::Logger.new($stdout)
And don't let is use the default Rails.logger which this gem overwrites.This should maybe be added as a note some where in this documentation. Or maybe ensure that this does not happens.