Skip to content

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

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

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
Copy link
Member

@marcotc marcotc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work!

@marcotc marcotc self-assigned this Mar 27, 2025
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.68%. Comparing base (bba20bf) to head (acc11dc).
Report is 175 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4496      +/-   ##
==========================================
- Coverage   97.70%   97.68%   -0.02%     
==========================================
  Files        1381     1381              
  Lines       83954    83970      +16     
  Branches     4253     4254       +1     
==========================================
+ Hits        82025    82027       +2     
- Misses       1929     1943      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@MathijsK93
Copy link

Are there any updates on the release of this?

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.

5 participants