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: Add compatibility with Rails 7.1+ #226

Merged
merged 1 commit into from Feb 28, 2024
Merged

Conversation

Flink
Copy link
Contributor

@Flink Flink commented Feb 27, 2024

Rails 7.1 introduced a new default logger (ActiveSupport::BroadcastLogger) that responds to a new method named #broadcast_to.

Our current logger isn’t compatible with it and we’re overwriting the Rails logger. This means that a Rails 7.1 will call #broadcast_to on the logger which will break.

This PR fixes the issue by using the new broadcast logger and adding our Logster logger to it when inside a Rails 7.1+ app.

For Rails < 7.1, we continue to replace the Rails logger with the Logster one.

@Flink Flink self-assigned this Feb 27, 2024
Rails 7.1 introduced a new default logger
(`ActiveSupport::BroadcastLogger`) that responds to a new method named
`#broadcast_to`.

Our current logger isn’t compatible with it and we’re overwriting the
Rails logger. This means that a Rails 7.1 will call `#broadcast_to` on
the logger which will break.

This patch fixes the issue by using the new broadcast logger and adding
our Logster logger to it when inside a Rails 7.1+ app.

For Rails < 7.1, we continue to replace the Rails logger with the
Logster one.
@Flink Flink marked this pull request as ready for review February 28, 2024 11:57
@Flink Flink merged commit a023d77 into main Feb 28, 2024
15 checks passed
@Flink Flink deleted the loic-fix-for-rails-7.1 branch February 28, 2024 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants