Audit trails for Go, made effortless.
Automatic data-change capture, API call logging, and time-travel snapshots — with zero external dependencies in the core.
Everything you need to audit confidently.Everything you need to ship audit-ready
Battle-tested primitives that drop into any Go service, big or small.
Automatic data-change capture
Hook into your ORM and capture every insert, update, and delete with zero boilerplate.
API call logging
Middleware records every request and response with status, latency, and actor metadata.
Cross-concern correlation
Trace IDs unify API calls and DB changes so you can replay an entire user action end-to-end.
Snapshot & restore
Time-travel any record to any point in history and restore previous state with a single call.
Soft-delete detection
Recognises GORM, Bun and Ent soft-delete patterns automatically — no extra wiring required.
Retention & purge
Configure rolling retention windows and compliant data purge to keep storage bounded.
Drop-in for GORM
Three lines of setup is all it takes. Register the auditor, run the migration, and plug it into your ORM. go-audit takes over from there — capturing changes, snapshots, and correlation IDs across your stack.
// Initialise the auditor
auditor, err := goaudit.New(goaudit.Config{
DB: db,
Driver: goaudit.PostgreSQL,
Tables: goaudit.Tables{
DataChanges: "audit_logs",
APICalls: "api_logs",
},
})
// Run schema migration
auditor.Migrate(ctx)
// Plug into GORM
gormdb.Use(gormadapter.New(auditor))Browse the docsPick where to start
Get auditing in 5 minutes — install, configure, and capture your first change event.
Every type, function, and option documented with copy-pasteable Go examples.
Detailed integration recipes for GORM, Bun, and Ent — including custom hooks.