reidmorrison / rails_semantic_logger

Rails Semantic Logger replaces the Rails default logger with Semantic Logger
https://logger.rocketjob.io/rails
Apache License 2.0
320 stars 114 forks source link

Exception: NoMethodError: undefined method `tags' for an instance of Logger #210

Open juna-nb opened 6 months ago

juna-nb commented 6 months ago

Environment

Provide at least:

Development server logs:

Rails -- Exception: NoMethodError: undefined method `tags' for an instance of Logger
~/.asdf/installs/ruby/3.3.0/lib/ruby/gems/3.3.0/bundler/gems/rails_semantic_logger-93fed9edd0ba/lib/rails_semantic_logger/extensions/action_cable/tagged_logger_proxy.rb:7:in `tag'
~/.asdf/installs/ruby/3.3.0/lib/ruby/gems/3.3.0/gems/actioncable-7.1.3/lib/action_cable/connection/tagged_logger_proxy.rb:40:in `log'
~/.asdf/installs/ruby/3.3.0/lib/ruby/gems/3.3.0/gems/actioncable-7.1.3/lib/action_cable/connection/tagged_logger_proxy.rb:34:in `block (2 levels) in <class:TaggedLoggerProxy>'
~/.asdf/installs/ruby/3.3.0/lib/ruby/gems/3.3.0/gems/actioncable-7.1.3/lib/action_cable/connection/base.rb:75:in `process'
~/.asdf/installs/ruby/3.3.0/lib/ruby/gems/3.3.0/gems/actioncable-7.1.3/lib/action_cable/server/base.rb:36:in `call'
~/.asdf/installs/ruby/3.3.0/lib/ruby/gems/3.3.0/gems/actionpack-7.1.3/lib/action_dispatch/routing/mapper.rb:22:in `block in <class:Constraints>'

Browser console error as a result:

WebSocket connection to 'ws://localhost:3000/cable' failed: 

Behavior

On a Rails 7 app with a fresh install of StimulusReflex the example page it generates works when rails_semantic_logger is not installed but gives the above error and doesn't work when rails_semantic_logger is installed. Both the latest version of rails_semantic_logger and today's master brach cause the error.

reidmorrison commented 2 months ago

This issue is probably related: https://github.com/reidmorrison/rails_semantic_logger/issues/220