You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This initializer wraps the existing Rails logger into ActiveSupport::TaggedLogging, which for the default Rails config is not bad, but when custom loggers are in place, it could be troublesome.
I, for instance, currently have a custom logger that mimics TaggedLogging and supports its interface. I think we should just test if the existing Rails logger responds to .tagged and then call it instead of re-wrapping it. Something like that (haven't tested yet):
initializer"dotenv",after: :initialize_loggerdo |app|
# Set up a new logger once Rails has initialized the logger and replay logs new_logger= ::Rails.logger&.tagged("dotenv") || ::Rails.loggerlogger.replaynew_loggeriflogger.respond_to?(:replay)self.logger=new_loggerend
What do you think? By the way, awesome work on the new release! 👍
The text was updated successfully, but these errors were encountered:
dotenv/lib/dotenv/rails.rb
Lines 91 to 96 in 6dd0385
This initializer wraps the existing Rails logger into
ActiveSupport::TaggedLogging
, which for the default Rails config is not bad, but when custom loggers are in place, it could be troublesome.I, for instance, currently have a custom logger that mimics
TaggedLogging
and supports its interface. I think we should just test if the existing Rails logger responds to.tagged
and then call it instead of re-wrapping it. Something like that (haven't tested yet):What do you think? By the way, awesome work on the new release! 👍
The text was updated successfully, but these errors were encountered: