Audit logs

Your project automatically records audit logs for all CRUD operations, authentication events, and API key calls. Logs are viewable from the /audit-log page with filtering, sorting, and an activity chart.

What gets logged

CRUD operations

Every create, update, and delete operation on any entity is automatically logged with the old and new data.

Authentication events

OperationCode
Sign inSI
Sign in failedSIF
Sign outSO
Sign upSU
Password reset requestPRR
Password reset confirmPRC
Password changePC
Email verify confirmVEC
Email change requestECR
Email change confirmECC

API key calls

Every API call made with an API key is logged with:

OperationCodeHTTP method
API GETAGGET
API POSTAPOPOST
API PUTAPUPUT
API DELETEADDELETE

API key audit logs also record the endpoint path and HTTP response code.

Audit log page

The /audit-log page displays:

  • Activity chart: Visual chart of activity over time (requires timezone from the browser).
  • Log table: Paginated list of all audit entries with human-readable descriptions.
  • View dialog: Click any log to see the full old/new data diff.

Filtering

Logs can be filtered by:

  • Entity name
  • Operation type
  • Timestamp range
  • API key
  • Member
  • API endpoint
  • HTTP response code

Data recorded

Each audit log entry stores:

FieldDescription
entityIdID of the affected record
entityNameName of the entity (e.g., "Member", "User")
operationOperation code (see tables above)
oldDataPrevious state of the record (JSON)
newDataNew state of the record (JSON)
userIdUser who performed the action
memberIdMember who performed the action
organizationIdOrganization context
apiKeyIdAPI key used (if applicable)
apiHttpResponseCodeHTTP response code (API key calls only)
apiEndpointAPI endpoint path (API key calls only)
timestampWhen the action occurred

Data sanitization

Before storing, audit data is sanitized:

  • downloadUrl properties are removed (signed URLs shouldn't be logged)
  • Date objects are converted to ISO strings
  • Prisma Decimal objects are converted to strings

Permissions

Audit log viewing requires the auditLog permission resource with read action. Admins have this permission by default.

API endpoints

MethodPathDescription
GET/api/audit-logList audit logs (filtered)
GET/api/audit-log/activity-chartActivity chart data

Key files

FileDescription
backend/src/features/auditLog/auditLogCreate.tsCreates audit log entries
backend/src/features/auditLog/auditLogOperations.tsOperation code definitions
backend/src/features/auditLog/auditLogApiKeyCall.tsAPI key call logging
backend/src/features/auditLog/auditLogApiRoutes.tsAPI routes
frontend/src/features/auditLog/pages/AuditLogListPage.tsxAudit log list page
frontend/src/features/auditLog/components/AuditLogViewDialog.tsxDetail view dialog