-
-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NoMethodError: undefined method `current_tags' for nil:NilClass; Rails 5 + ActionCable #29
Comments
Just noticed that it may belongs to semantic_logger repo, not the rails one, as indicated by backtrace. |
Rails Semantic Logger attempts to In this case Action Cable is supposed to be patched with the following code in Rails Semantic Logger: https://github.com/rocketjob/rails_semantic_logger/blob/master/lib/rails_semantic_logger/extensions/action_cable/tagged_logger_proxy.rb Can you tell if the method |
Looks like I removed the wrong method. I put the correct one back, can you please try again against master, or let me know if you need a Gem ASAP. Thank you, |
Works nicely. Thank you so much for the quick patch. I can live with github head until you have a new release, so no rush 😃 |
@reidmorrison I am using good_job gem for background jobs and I am facing the same issue.
Do we have any solution for that as well? |
You will need to either remove the good job log subscriber, or monkey patch
it in some way.
Consider using Rocket Job <https://rocketjob.io> since it has natively
adopted Semantic Logger.
…On Mon, Nov 23, 2020 at 12:53 PM harry43 ***@***.***> wrote:
@reidmorrison <https://github.com/reidmorrison> I am using good_job gem
for background jobs and I am facing the same issue.
NoMethodError: undefined method `current_tags' for nil:NilClass ["good_job-1.3.2/lib/good_job/log_subscriber.rb:198
https://github.com/bensheldon/good_job/blob/main/lib/good_job/log_subscriber.rb
Do we have any solution for that as well?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#29 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABD3JCIB7WEWOPRVL33YNLSRKOTHANCNFSM4DBWEHCQ>
.
|
Thanks for the quick reply. I will definitely look into rocket job. |
@harry43 I ran into the same issue when using good_job. The issue is that rails_semantic_logger sets Rails.logger to a new Logger object with no formatter
Simple solution is to add a formatter. Put this in an initializer formatter = ActiveSupport::Logger::SimpleFormatter.new
formatter.extend ActiveSupport::TaggedLogging::Formatter
Rails.logger.formatter = formatter |
Where
action_cable/connection/tagged_logger_proxy.rb:21
saysProblem only gets hit by action cable connections. On latest github version.
The text was updated successfully, but these errors were encountered: