Rails guide

Activity log or audit log for Rails: which gem?

“Activity log” means different things to different teams. Sometimes it is a history of every change to a record. Sometimes it is a feed of what users did. Sometimes it is analytics. The usual Rails gems each solve one of these well. Here is what each one records, so you can pick the right one, or combine them.

Written by the EZLogs team, so we are biased. We have tried to describe the other tools fairly; check their docs for details.

The short answer

You needGood fit
The full history of a record, and the option to restore an old versionPaperTrail
A record of who changed which columns, stored in your own databaseAudited (or PaperTrail)
An in-app feed like “Ana commented on your post” that you design yourselfpublic_activity
Visits, traffic sources and product events for analyticsAhoy
A plain-English feed of everything that happened (requests, background jobs and database changes together) that anyone on the team can read, and that AI assistants can queryEZLogs

PaperTrail

PaperTrail adds has_paper_trail to the models you choose. On each create, update and destroy it stores a version row in a versions table in your database, with the changes and, if you set it, whodunnit (who made the change). You can see what a record looked like at a given time and restore it.

Pick it when you need record history or undo, inside your own database. It does not record requests or background jobs as events of their own (you can attach request details such as the IP to each version with info_for_paper_trail), and its versions are data for developers, not sentences for the rest of the team.

Audited

Audited adds audited to your models and writes each change to an audits table, with the changed columns, the action, the current user, and the request’s IP address and request id. You can limit it to some columns and group audits under a parent record.

Pick it when you want a simple “who changed what” trail in your own database. It does not record requests or jobs as events of their own: only model changes, tagged with the request they came from.

public_activity

public_activity records activities on your models (create, update, destroy, or your own keys) with an owner and the record involved, and you render each one with your own view partial. It is built for user-facing feeds, like a timeline inside your product.

Pick it when you are building a feed for your users and want control over each line. You write the wording and choose what to track.

Ahoy

Ahoy is first-party analytics for Rails. It records visits (referrer, device, and location if you enable geocoding) and events you track from Ruby or JavaScript, in your own database.

Pick it when you want to know how people use your product in aggregate. It is not a record of database changes.

EZLogs

EZLogs is a hosted activity log. The ez_logs_agent gem captures your requests, Sidekiq and ActiveJob runs, ActiveRecord changes and bulk SQL like update_all, with no per-model or per-controller code. EZLogs links them by request and record, then shows one plain-English card per action: “Refund failed: card expired”, with who did it (a person, an AI agent or the system) and which records it touched. Support, product and founders can read it without asking an engineer. You can also connect Claude, ChatGPT or Cursor over MCP and ask what happened.

Trade-offs, honestly:

Many teams run both: an audit gem for record history, and EZLogs for the readable story of what happened across requests, jobs and data.

Try EZLogs on your Rails app

bundle add ez_logs_agent
rails generate ez_logs_agent:install

Set EZLOGS_API_KEY and restart. The full steps are on the Rails page, and there is a copy-paste prompt for your coding AI at app.ezlogs.io/install/rails.md.

Start free →

No card required · Read-only by design

← Back to home