Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ AllCops:
Style/Documentation:
Enabled: false

Naming/FileName:
Exclude:
- 'posthog-rails/lib/posthog-rails.rb'

# Modern Ruby 3.0+ specific cops
Style/HashTransformKeys:
Enabled: true
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## Unreleased

1. feat: Add posthog-rails gem for automatic Rails exception tracking
- Automatic capture of unhandled exceptions via Rails middleware
- Automatic capture of rescued exceptions (configurable)
- Automatic instrumentation of ActiveJob failures
- Integration with Rails 7.0+ error reporter
- Configurable exception exclusion list
- User context capture from controllers

## 3.3.3 - 2025-10-22

1. fix: fallback to API for multi-condition flags with static cohorts ([#80](https://github.com/PostHog/posthog-ruby/pull/80))
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ Specifically, the [Ruby integration](https://posthog.com/docs/integrations/ruby-
>
> All 2.x versions of the PostHog Ruby library are compatible with Ruby 2.0 and above if you need Ruby 2.0 support.

## Rails Integration

**Using Rails?** Check out [posthog-rails](posthog-rails/README.md) for automatic exception tracking, ActiveJob instrumentation, and Rails-specific features.

## Developing Locally

1. Install `asdf` to manage your Ruby version: `brew install asdf`
Expand Down
4 changes: 2 additions & 2 deletions lib/posthog/logging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def logger
return @logger if @logger

base_logger =
if defined?(Rails)
Rails.logger
if defined?(::Rails)
::Rails.logger
else
logger = Logger.new $stdout
logger.progname = 'PostHog'
Expand Down
Loading