Rails error tracking should not be a weekend project. With the errsight gem you add one dependency, set one environment variable, and write a four-line initializer. Then every exception, routing error, and log line shows up in real time.

This is a practical how-to. By the end you will have production-grade Rails error tracking wired up, a test error confirmed in the live log viewer, and rich user context attached to every event. Total hands-on time: under two minutes.

Step 1: Add the gem

Drop the gem into your Gemfile:

# Gemfile
gem "errsight"

Then install it:

bundle install

That is the only dependency you add. The gem hooks into Rails through standard middleware and Rails.logger, so there is nothing to patch and nothing to monkey-fix later.

Step 2: Grab an API key and set the environment

Create a project in ErrSight and copy its API key. Keys look like elp_live_… for production traffic (generic keys use the elp_… prefix). Keep the key out of source control by setting it as an environment variable:

export ERRSIGHT_KEY="elp_live_your_key_here"

In development you would put this in your .env, your shell profile, or your secrets manager. In production, set it through your platform’s config (Heroku config vars, a Kubernetes secret, your CI/CD environment, wherever you already manage env). The point of ErrSight is that you ship where you already ship; the key travels with the rest of your environment.

Step 3: The initializer

Create a single initializer. This is the whole configuration:

# config/initializers/errsight.rb
Errsight.configure { |c| c.api_key = ENV["ERRSIGHT_KEY"] }

Boot your app. That is the full setup: one gem, one env var, one initializer. You are now tracking errors.

Step 4: What you get for free

The default install is deliberately generous. Without writing another line, the gem:

  • Captures every Rails exception and routing error automatically, including the 404s and ActionController::RoutingErrors that usually slip past.
  • Broadcasts from Rails.logger at all levels (debug through fatal) into a terminal-style live log viewer with infinite scroll and keyword search.
  • Attaches request context on every event: the request URL, the controller and action, request metadata, and the current user.
  • Speaks Devise and ActiveAdmin out of the box, with first-class support, so the authenticated user and admin context come through without glue code.
  • Respects config.filter_parameters: anything you already mask (passwords, tokens, card numbers) stays local and never leaves your app.

That last point matters: ErrSight reuses the parameter filtering you have already configured, so sensitive fields are redacted before they are ever sent.

Duplicate exceptions are grouped through fingerprinting, so a failing query that fires on every request in a hot loop becomes one actionable issue you can triage (mark, assign, or snooze) instead of a wall of identical notifications.

Step 5: Trigger a test error to verify

Let’s confirm it works. Add a throwaway route and action that raises:

# config/routes.rb
get "/boom", to: "diagnostics#boom"
# app/controllers/diagnostics_controller.rb
class DiagnosticsController < ApplicationController
  def boom
    raise "ErrSight smoke test. If you can read this in the log viewer, it works"
  end
end

Start the server and hit the route:

bin/rails server
curl -i http://localhost:3000/boom

Open the live log viewer in your ErrSight dashboard. Within a moment you will see the exception, grouped into an issue, complete with the stack trace, the /boom URL, the DiagnosticsController#boom action, and (if a user is signed in) their identity. Search the log viewer for smoke test to jump straight to the broadcast line.

Once you have confirmed it, delete the route and controller. They were only there to prove the wiring.

Step 6: Adding richer user context

You already get the current user automatically (id, email, session, plan). When you want to attach more (a tenant id, a feature-flag cohort, the plan tier at the moment of failure), set it explicitly. A common pattern is a before_action:

# app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
  before_action :set_errsight_context

  private

  def set_errsight_context
    return unless current_user

    Errsight.set_user(
      id:    current_user.id,
      email: current_user.email,
      plan:  current_user.plan,
      org:   current_user.organization_id
    )
  end
end

Now every event captured during that request carries the context you care about. When a 500 lands at 3 a.m., you already know who hit it and what plan they were on. No log spelunking required.

Is this safe for production?

Yes: that is the whole design. Events are batched on a background thread and flushed on a timer, so the work never touches your request cycle. The async overhead per request is sub-millisecond, and nothing blocks the response. On process exit the buffer is flushed, so you do not drop the errors that happen during a deploy or a crash.

Concern How ErrSight handles it
Request latency Sub-millisecond async overhead; nothing blocks the request
Throughput Events batched on a separate thread, flushed on a timer
Dropped events Buffer flushed on process exit, nothing lost at shutdown
Sensitive data config.filter_parameters respected; filtered fields stay local
Noise Duplicate exceptions grouped via fingerprinting into one issue

In other words, you can leave it on at full volume in production without worrying that error tracking is the thing that slows down your app.

Where to go next

That is Rails error tracking in two minutes: one gem, one key, one initializer, and a live view of every exception and log line. From here you can:

  • Browse the ErrSight documentation for advanced configuration and triage workflows.
  • See the other SDKs and platforms on the integrations page: Python, Rust, React/JavaScript, and React Native are shipping today, with Node, Go, PHP/Laravel, and Elixir on the way.
  • Read why we built ErrSight for the philosophy behind native logs plus exception tracking.
  • Review the pricing: flat monthly tiers, no overage fees.

Want to self-host instead? The engine is open source under AGPLv3 at ErrSight-OSS: same ingestion, fingerprinting, and alerting, no lock-in by design.

Start tracking today

Spin up a free project ($0/month, forever, no credit card) and point your Rails app at it. Add the gem, set ERRSIGHT_KEY, and watch your first error land in the live viewer. Get started at errsight.com.