Closed jesseyoungmann closed 3 months ago
@jesseyoungmann Based on the diff, to me it looks like an honest mistake, and closed_appenders
should be the correct variable name, and renaming it the only fix... given I'm in a bit of a hurry, I'll just post a PR with your suggestion, so there's a version we can refer to on our Gemfile in our apps :)
Calling
config.semantic_logger.clear_appenders!
raises an error ofException: NameError: undefined local variable or method 'appenders'
after upgrading from semantic_logger4.15.0
to4.16.0
, this appears to be caused by this commit: https://github.com/reidmorrison/semantic_logger/commit/f7d54bf21b6900f334155882ffd6ab287ffa58f5#diff-bfe54b7aa0c85191d839ffac6deaae7617c6cc1d8f241a74815aa7ad587fb537R52 Specifically, changing it fromappenders << appender
toclosed_appenders << appender
resolved the issue for me.Environment
I'm working with ruby 3.2.2, rails 7.1.3.4, and rails_semantic_logger 4.17.0.
Expected Behavior
I'm attempting to replace the logger in
config/environments/development.rb
with a custom logger, using:This should not raise an error, should remove the existing logger, and should add in my custom logger formatter.
Actual Behavior
Instead, I receive this error:
It then fails to add my development replacement logger:
Pull Request
Happy to make a pull request if the fix I mention is correct and if that's easier for you, let me know. Thanks very much for all the work on this library!