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
5.2.0 breaks some custom loggers #2700
Comments
@tragiclifestories sorry about that - lets revert that change 👍 |
Cheers! I think there must be a way to fix the original reported problem without breaking us, but I can't see one just yet. |
No worries, released 5.2.1 Yes, me neither. Makes sense to revert since it's possible a lot of people might be customising the logger. |
Feel free to close if all good |
Looks good. Thanks for the quick fix! |
Wow, this PR is a blast from the past. If my memory serves me correctly, the issue was around centralized logging and when you completely replace the rails logger so when Webpacker initializes it overwrites your logger with a new TaggedLogging instance. @tragiclifestories Sorry about introducing breaking changes. @gauravtiwari what about a config option or revert to the current implementation?
EDIT: looking a bit deeper, I do admit my fix was not the best solution. |
What changes happened in 5.2.0? No change log entries. |
@flippakitten thank you for update. Is it not possible to override @scottrobertson Mainly, dependencies update and some minor fixes: v5.1.1...5-x-stable |
Reverting this actually breaks it for us when using lograge. Changing it to the other way around works tho. Any idea why? Edit: Using webpacker 5.2.1 on Rails 5.2.4.4 Error
This change make it work 🤷♂️ initializer "webpacker.logger" do
config.after_initialize do
if ::Rails.logger.respond_to?(:tagged)
Webpacker.logger = ActiveSupport::TaggedLogging.new(::Rails.logger)
else
Webpacker.logger = ::Rails.logger
end
end
end |
We have our own internal logging library that enforces our company standards. It implements
#tagged
identically to ActiveSupport's TaggedLogging.Before #1311, webpacker would happily use our custom logger. But that PR flips the if statement, and now Webpacker is messing with our logger, replacing our formatter with some random unwanted one which is incompatible with our gem (we only emit structured JSON logs and handle the lines internally as hashes, so we get
no implicit conversion
errors instead of log lines).The text was updated successfully, but these errors were encountered: