Audit log
Read who changed what: 48 write paths record an actor, an action, a target and their metadata.
Writes that need an audit trail (a licence issued, a refund, a config save, a ticket reassigned,
a file deleted) append a row to audit_logs in the same code path that performs them. The
console lists the most recent 500 at /admin/audit. You can filter them by action and expand each row's
metadata.
Before you begin
- An account with
audit.read. See Roles and permissions. - Nothing to configure. The log records from the first request and has no provider.
Set it up
Give an auditor the permission, and only that
audit.read reads the log. It does not imply config.read, users.write or anything else, so you can give a
compliance reviewer an account that sees every change and cannot make any.
Read the log
/admin/audit lists actor, action, target and time. Filter by action to narrow the list. Expand
a row to read the metadata the write recorded, such as an order id, a provider name or a
permission key.
Record your own writes
When you add a write path, append to the log from the repository that performed it, so the entry is written together with the change:
await recordAudit("billing.refund.created", orderId, { provider, amountCents });actor names the subsystem that wrote the row. Metadata is JSON, so it is searchable later
without a migration.
What the log records today
48 call sites write to it, grouped by the subsystem that owns them:
| Prefix | Examples |
|---|---|
billing.* | checkout.created, refund.created, licences.issued, licences.revoked, portal.created |
support.* | ticket.created, ticket.replied, ticket.assignment.updated |
cms.* | entry.upserted, taxonomy.created |
email.*, notification.* | template.saved, delivery.recorded, webhooks.saved, preferences.updated |
affiliate.* | referral.created, conversion.recorded, payout.requested |
newsletter.*, waitlist.* | subscribed, unsubscribed, joined |
file.* | uploaded, deleted |
analytics.* | event.recorded |
The row
Prop
Type
The page snapshot also includes rate-limit rules and the 20 most recent webhook verification results, so you can inspect configuration changes and rejected events together.
Verify
- Issue a licence by hand from
/admin/licences. Abilling.licences.issuedrow appears at the top of/admin/auditwith the licence's target id. - Filter by that action. Only those rows remain.
- Expand the row. The metadata shows the product key and the user it was granted to.
- Sign in as a role without
audit.read. The page shows permission denied.
Reference
- Roles and permissions
- Rate limits: the rate-limit rules in the same snapshot
- Drizzle inserts: how a repository appends the row