Skip to content

Conversation

@PetrHeinz
Copy link
Member

@PetrHeinz PetrHeinz commented Oct 16, 2025

Upcoming Rails 8.1 introduces Structured Events

The logger will auto-subscribe to events when creating via create_default_logger, otherwise, you can add the subscription yourself using Rails.event.subscribe

It's a noop in Rails < 8.1, so there should be no worries with backward compatibility.

Updating the example project to Rails 8.1 RC1 to showcase the feature.

image

@PetrHeinz PetrHeinz requested a review from curusarn October 16, 2025 14:14
Copy link
Contributor

@curusarn curusarn left a comment

Choose a reason for hiding this comment

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

Thank you!

@PetrHeinz PetrHeinz merged commit 15ba2ac into main Oct 16, 2025
@PetrHeinz PetrHeinz deleted the ph/event-log-subscriber branch October 16, 2025 14:29
}

message = build_log_message(event)
logger.info("hello")

Choose a reason for hiding this comment

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

Is this on purpose? It floods our logs with hello 😄

Copy link
Member Author

Choose a reason for hiding this comment

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

🙈 Apologies, it's a forgotten debugging message - I'll fix that right away.

Copy link
Member Author

Choose a reason for hiding this comment

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

Please update to the freshly released v0.2.12 (https://rubygems.org/gems/logtail-rails). Thanks for reporting it! 🙌

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.

4 participants