Audit Logging
Every significant action is logged with who, what, when, and why. Designed for SOC 2 compliance.
What’s Logged
| Category | Actions | Details Captured |
|---|---|---|
| Forms | Create, edit, publish, delete, duplicate | Schema diff, field changes, version info |
| Submissions | Status changes, bulk operations | Before/after status, affected IDs |
| Settings | System settings, branding, integrations | Changed fields, before/after values |
| User Management | Role changes, invites, removals | Target user, old/new role |
| Data Access | Exports, PDF downloads | Format, record count |
| Authentication | Login/logout | User, IP (anonymized), user agent |
Log Structure
Using the Audit Functions
Basic Audit Log
With Request Context (IP/User Agent)
Convenience Functions
Querying Logs
Via API
Direct SQL
Access Review Report
For SOC 2 access reviews, export a report of all users with system access:- All users with access
- Their roles and permissions
- Account status (Active/Pending)
- Last activity timestamp
Retention Policy
Audit logs are retained for 7 years (2555 days) by default for SOC 2 compliance.Configuration
The retention period is stored insystem_settings.audit_retention_days.
Automated Cleanup
A daily cron job cleans up expired logs:vercel.json:
IP Anonymization
IP addresses are anonymized for privacy while preserving geographic analysis capability:- IPv4: Last octet zeroed (e.g.,
192.168.1.100→192.168.1.0) - IPv6: Last 80 bits zeroed
Immutability
Audit logs are append-only. The database enforces this via RLS:UI Dashboard
Access the audit log dashboard at Settings → Audit Logs:- View all actions with filtering by type, entity, date
- Search by user email or entity ID
- Export access review reports
- View detailed change diffs
Database Schema
Full table reference
Security
Security best practices