-
-
Notifications
You must be signed in to change notification settings - Fork 200
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
Not all loggers have a formatter #502
Comments
Thanks for the heads up! That can be feature-tested for in GoodJob. Looks like tagged logging might also be a problem too. |
Thanks for the quick response. Another observation: using the fix I put in that issue, GoodJob starts logging twice, once with its own logger (I'm guessing) and one with Rails.logger
|
Looking at this now. My assumption was that any logger that is a tagged logger would have a populated formatter. I can guard against that being nil too. good_job/lib/good_job/log_subscriber.rb Lines 197 to 198 in 2bb4782
Also, I was curious why GoodJob has this problem because I borrowed the log tagging structure from ActiveJob. Looks like SemanticLogger monkey patches Rails: Here's the original method in ActiveJob that SemanticLogger patched around, which calls the formatter: |
good_job/lib/good_job/log_subscriber.rb
Line 198 in 2bb4782
each_logger.formatter
can be nilIssue mentioned in reidmorrison/rails_semantic_logger#29
The text was updated successfully, but these errors were encountered: