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

Fix log subscriber #74

Merged
merged 1 commit into from
Aug 16, 2024
Merged

Fix log subscriber #74

merged 1 commit into from
Aug 16, 2024

Conversation

shahidkhaliq
Copy link
Contributor

@shahidkhaliq shahidkhaliq commented May 1, 2024

Using both rails_semantic_logger and activejob-uniqueness together in Rails 6.0.x results in duplicated logs as reported in #73.

The Issue

  1. Rails 6.0.x has ActiveJob::Logging::LogSubscriber.attach_to :active_job.
  2. activejob-uniqueness has ActiveJob::LogSubscriber.attach_to :active_job_uniqueness.
  3. rails_semantic_logger expects to see one of these but replaces both of these with it's own logger here. And thus duplicating logging.

The Solution

This PR ensures that we are creating and attaching a unique log subscriber ActiveJob::Uniqueness::LogSubscriber and not creating the ActiveJob::LogSubscriber class in older Rails versions.

@shahidkhaliq
Copy link
Contributor Author

@sharshenov could you take a look, please?

@sharshenov sharshenov merged commit b985597 into veeqo:main Aug 16, 2024
@sharshenov
Copy link
Member

Thank you for the fix. It has been shipped with version 0.3.2 https://rubygems.org/gems/activejob-uniqueness/versions/0.3.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants