LogarithmA self-hosted audit log for SaaS apps: who changed what, and when. Field-level diffs in your own Postgres or SQLite, and a ready React view for your customers' admins.
pnpm add @sweberdev/logarithm @sweberdev/logarithm-reactSooner or later a B2B customer asks who changed what in their account, and security questionnaires, ISO 27001 and SOC 2 audits ask the same. Logarithm records it with one call: actor, action, targets and a field-level diff computed from the state before and after. Passwords, tokens and card numbers are never stored, also inside nested objects.
Events live in your own database: Postgres 13+ (also Neon and Supabase), MySQL 8 and MariaDB, or SQLite (better-sqlite3, node:sqlite, Bun). Every event belongs to a tenant, and a scoped log cannot read other tenants. A Fetch API handler serves Next.js, Remix, Hono or Workers, and the React view shows your customers' admins an activity log with search, filters, day groups and diffs, in English, German, French and Italian. No external service, MIT-licensed.
Example
A short exampleCopy it into your project.
app/projects/actions.ts
import { createAuditLog } from "@sweberdev/logarithm"
import { postgresStore } from "@sweberdev/logarithm/postgres"
const audit = createAuditLog({ store: postgresStore({ client: pool }) })
await audit.with({ tenantId: org.id, actor: { id: user.id, name: user.name } }).record({
action: "project.updated",
targets: [{ type: "project", id: project.id, name: project.name }],
before: project, // { plan: "free", smtpPassword: "…" }
after: updated, // diff: plan free → pro, smtpPassword [redacted]
})Features
What you getFree under MIT, with Pro on top.
Free, MIT
- Audit events in one call, with field-level diff and redaction of secrets
- Stores for Postgres, MySQL and SQLite, multi-tenant by default
- React activity view and object history
- Filters, paging and a Fetch API handler
- CloudEvents and OpenTelemetry mappings
Pro
- Everything in Free
- Tamper evidence with a hash chain and signed checkpoints
- Retention per customer with archive to S3 or R2
- Export for your customers and signed evidence pack
- Forwarding to Splunk, Datadog and Elasticsearch, alerts and anomaly detection
- SOC 2 and ISO 27001 evidence and an admin server
All features in detail
Free, MIT
- Record events in one call: actor, action, targets and a field-level diff from before and after
- Passwords, tokens, API keys and card numbers stored as [redacted], also in nested objects and metadata
- Stores for Postgres 13+ (Neon, Supabase), MySQL 8 and MariaDB, and SQLite (better-sqlite3, node:sqlite, Bun), or your own
- Multi-tenant by default: a scoped log cannot read other tenants
- Filters by actor, action prefix, target, time and text, with keyset paging
- Fetch API handler for Next.js, Remix, Hono and Workers, with your own access check
- A conformance suite (@sweberdev/logarithm/testing) so a store for another database behaves exactly like the built-in ones
- contextFromRequest() fills IP, browser, request id and location from Vercel, Cloudflare or Nginx headers
- React activity view with search, filters, day groups and diffs, in English, German, French and Italian
- Compact <ActivityFeed> with relative times for dashboards and project pages
- Outcome (success, failure, denied) and a correlation id on every event, filterable in queries, over HTTP and in the viewer
- CloudEvents 1.0 and OpenTelemetry log mappings, and Postgres partitioning by month or year
- <ObjectHistory> shows every change to one object with a diff and a field filter
Pro
- Tamper evidence: an HMAC hash chain per tenant, signed checkpoints with trusted RFC 3161 timestamps, a verifier that names changed, removed or reordered events, and an in-code check of the timestamp authority's signature and certificate chain
- Retention periods per customer with archiving to S3 or Cloudflare R2 and legal holds, GDPR and Swiss FADP erasure and access requests, each run recorded in the log and reportable as CSV or print page for auditors
- Streamed CSV, NDJSON and JSON export for your customers, and a signed evidence pack for auditors with events, integrity report, checkpoints and retention report as one ZIP
- Forwarding to signed webhooks, Splunk, Datadog, Elasticsearch, OpenSearch and Loki, with retries and a dead-letter queue
- Alerts to Slack, Teams, webhook and e-mail, and anomaly detection for mass deletions, mass changes, off-hours permission changes and new IPs, with thresholds that learn what is normal for each tenant
- SOC 2 and ISO 27001 control evidence from the log, monthly evidence packs per customer, and read-only auditor links that expire and are logged
- A ready-to-run admin server (Docker image or Node.js): search and export for your customers' admins, one tenant per sign-in, event ingest over HTTP and the alerts above (beta: Postgres/MySQL through the server and e-mail delivery are not tested against live services)
| Feature | Free | Pro |
|---|---|---|
| Events, diffs and redaction | Included | Included |
| Postgres and SQLite stores | Included | Included |
| Tenant-scoped queries and API handler | Included | Included |
| React activity view | Included | Included |
| Outcome, correlation id and object history | Included | Included |
| Tamper evidence (hash chain and verifier) | Not included | Included |
| Retention with archiving | Delete by date | Included |
| GDPR/FADP erasure and access requests | Not included | Included |
| CSV/NDJSON export and SIEM forwarding | Not included | Included |
| Control evidence, monthly packs and auditor access | Not included | Included |
| Admin server for your customers' admins, anomaly alerts | Not included | Included |
| Licence | MIT | Per person |
| Support | GitHub issues | Agency and Lifetime |
Pro
Pro packagesAdd-ons on top of the core.
Try the themes, browse the catalog and read a real scanner report. The demo also shows the GTM container check, the monitoring of many client sites and the catalog changes per project.
@weber-development/logarithm-integrityHMAC hash chain per tenant and a verifier that shows which event was changed, removed or reordered.
@weber-development/logarithm-retentionRetention periods per customer with archiving, erasure with a stable pseudonym and access-request export.
@weber-development/logarithm-exportStreamed CSV, NDJSON and JSON downloads, forwarding to Splunk, Datadog and webhooks, Slack, Teams and e-mail alerts with anomaly rules, SOC 2 / ISO 27001 control evidence, monthly evidence packs and read-only auditor access.
@weber-development/logarithm-serverReady-to-run admin server as a Docker image or with Node.js: search and export for your customers' admins, token, JWT or proxy sign-in per tenant, event ingest over HTTP and anomaly alerts.
Pricing
PricingPrices are in CHF.
Logarithm Pro is also part of the Compliance Bundle. See the Compliance Bundle
Team
RecommendedFor teams of up to ten named people, one price.
CHF 890
per year
2 months free
- Up to 10 people
- Support included
Lifetime
Pay once for up to ten people and keep updates and repository access.
CHF 2’990
one-time
- Up to 10 people
- Support included
11 people or more: get in touch
- After cancelling, every version you already received keeps working. Only updates and repository access end.
- No licence key, no phone-home. The packages never contact a server to check your licence.
- The licence covers the people who build with Logarithm Pro. The users of your SaaS app need nothing.
- Checkout, invoices and VAT are handled by Polar as merchant of record.
FAQ
QuestionsShort answers.
Why not a hosted audit log service?
Audit events contain personal data and say a lot about your customers. With Logarithm they stay in the database you already run and back up, and there is no per-event bill.
Which databases are supported?
Postgres 13 or newer, including Neon and Supabase, and SQLite 3.38 or newer via better-sqlite3, node:sqlite or Bun. Other databases work by implementing a small store interface.
Can a customer see another customer's events?
Not through Logarithm. The API handler takes the tenant from your access check, and a log scoped to a tenant adds it to every query.
Is the log tamper-proof?
The free version stores events like any other table; restrict the app's database role to INSERT and SELECT. Logarithm Pro adds a hash chain that makes later changes visible, even to someone with database access.
What about GDPR and the Swiss FADP?
Secrets are never stored and you control retention. Logarithm Pro handles erasure with a stable pseudonym and collects a person's events for access requests. This is not legal advice.
Can I use the open-source part on its own?
Yes. @sweberdev/logarithm and @sweberdev/logarithm-react are MIT-licensed and complete without Pro.
Articles
ArticlesGuides and release notes.
2026-10-13
Compliance Bundle 2.0: all five packages on 2.0, plus new Pro extensionsPermito, Surjection, Logarithm, Inverse and Witness are on 2.0, for free and Pro. Pro 2.1 adds a case inbox and monitoring for Inverse, a Consent Mode check for Permito and pull request comments for Surjection, all marked beta. Prices stay as they are.
2026-10-05
The Compliance Bundle: three Pro add-ons, one licencePermito Pro, Surjection Pro and Logarithm Pro together from CHF 49 a month. New compliance packages join at no extra cost. Also: new prices for Cosine Pro and Derivative Pro.