Skip to content
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

Update lograge/patcher.rb so that the correct logger is checked #4496

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

esposito
Copy link

What does this PR do?
In this PR I make sure that when the Lograge logger is present, it is checked instead of the Rails logger for showing a warning about tagged logging.

Motivation:
When the lograge keep_original_rails_log option is used, the lograge logger cannot be found in ::Lograge::LogSubscribers::ActionController, as the existing actioncontroller log subscriber is never removed. Therefore the warning in lograge/patcher.rb is shown even when lograge does use a plain logger.

Change log entry
Hide the warning about tagged logging when Lograge uses a plain logger and keep_original_rails_log is enabled.

Additional Notes:

How to test the change?
The change should be covered by the tests. If you want to test it manually, enable the Lograge keep_original_rails_log config option, keep the default Rails logger but use a plain logger in the lograge config. Now there should no longer be an error about tagged logging.

@esposito esposito requested a review from a team as a code owner March 14, 2025 11:41
@github-actions github-actions bot added integrations Involves tracing integrations tracing labels Mar 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrations Involves tracing integrations tracing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant