Audit Logging¶
Track all administrative and moderation actions.
Overview¶
Audit logs record: - Who performed the action (actor) - What action was taken - What was affected (entity) - When it occurred - Before/after state (for changes) - IP address and user agent
Purpose: - Compliance and accountability - Security monitoring - Troubleshooting - Change tracking
View Audit Logs¶
Admin → Audit Logs
Log Entries¶
Each entry shows: - Actor: User who performed action - Action: What was done (e.g., "QUESTION_ANSWER", "USER_ROLE_CHANGE") - Entity: What was affected (question ID, user ID, etc.) - Timestamp: When action occurred - Details: Before/after state, additional context - IP Address: Actor's IP - User Agent: Actor's browser/client
Actions Logged¶
User Management¶
USER_CREATE- User createdUSER_UPDATE- User updatedUSER_DELETE- User deletedUSER_ROLE_CHANGE- Role assigned/changedUSER_TEAM_ADD- Added to teamUSER_TEAM_REMOVE- Removed from team
Question Management¶
QUESTION_CREATE- Question submittedQUESTION_ANSWER- Question answeredQUESTION_PIN- Question pinnedQUESTION_UNPIN- Question unpinnedQUESTION_FREEZE- Question frozenQUESTION_UNFREEZE- Question unfrozenQUESTION_DELETE- Question deletedQUESTION_TAG_ADD- Tag addedQUESTION_TAG_REMOVE- Tag removed
Team Management¶
TEAM_CREATE- Team createdTEAM_UPDATE- Team updatedTEAM_DELETE- Team deletedTEAM_MEMBER_ADD- Member addedTEAM_MEMBER_REMOVE- Member removedTEAM_MEMBER_ROLE_CHANGE- Member role changed
System Administration¶
SETTINGS_UPDATE- Tenant settings changedTAG_CREATE- Tag createdTAG_UPDATE- Tag updatedTAG_DELETE- Tag deletedEXPORT_CREATE- Data export generated
Moderation¶
CONTENT_MODERATE- Content flaggedCONTENT_APPROVE- Content approvedCONTENT_REJECT- Content rejected
Filter Logs¶
By Actor¶
Search by user email or name to see all their actions.
By Action¶
Filter by specific action type (e.g., all role changes).
By Entity¶
Filter by entity ID (e.g., all actions on specific question).
By Date Range¶
Select start and end dates.
Combined Filters¶
Use multiple filters together (e.g., actor + action + date range).
Export Logs¶
- Admin → Audit Logs
- Apply filters (optional)
- Click "Export"
- Choose format: CSV or JSON
- Download
Use cases: - Compliance reports - Security investigations - Change tracking - Data retention
Log Retention¶
- Logs are append-only (cannot be modified or deleted)
- Retained indefinitely by default
- No automatic deletion
Custom retention: Configure in database or implement archival process.
Common Queries¶
Who Answered This Question?¶
- Filter by Entity: Question ID
- Filter by Action:
QUESTION_ANSWER
Who Changed This User's Role?¶
- Filter by Entity: User ID
- Filter by Action:
USER_ROLE_CHANGE
All Actions by User¶
- Filter by Actor: User email
All Failed Login Attempts¶
- Filter by Action:
LOGIN_FAILED
Changes in Last 24 Hours¶
- Filter by Date: Yesterday to Now
Security Monitoring¶
Suspicious Activity¶
Monitor for: - Multiple failed login attempts - Unusual role changes - Bulk deletions - Off-hours administrative actions
Investigation Workflow¶
- Identify issue: Notice suspicious activity
- Check audit logs: Filter by relevant criteria
- Verify actor: Confirm user identity
- Review actions: Examine what was done
- Take action: Revert changes if needed, contact user
Compliance¶
Audit logs provide evidence for: - SOC 2 compliance - GDPR data handling - Internal audits - Security incidents
Log Details¶
Before/After State¶
Changes show:
Contextual Information¶
Some logs include: - Reason (if provided) - IP address - User agent - Session ID - Bulk operation ID (for batch changes)
Access Control¶
Who can view audit logs: - Admins - Owners
Who cannot view: - Viewers - Members - Moderators
Visibility: - All actions across all teams - No team-scoping for audit logs
Best Practices¶
- Regular reviews: Check logs weekly for unusual activity
- Compliance reporting: Export logs monthly/quarterly
- Incident response: Check logs first when investigating issues
- Role changes: Always review who changed roles and why
- Data exports: Monitor who exports data
Limitations¶
Not logged: - User logins (except failures) - Question views - Upvotes - Search queries - Pulse responses (anonymous by design)
Why: Privacy and performance. Only administrative actions are logged.
Troubleshooting¶
Cannot Find Log Entry¶
Check: - Correct date range selected - Filters not too restrictive - Action actually occurred (verify in UI)
Log Shows Wrong Actor¶
Possible causes: - System action (shows as "system" actor) - Automated process (cron, queue worker) - Impersonation (admin acting as user)
Export Fails¶
Solutions: - Reduce date range - Apply more specific filters - Contact support if persists
Related Documentation¶
- handbook/SECURITY_MODEL.md - Security model
- Roles & Permissions - Who can do what
- Data Export - Export other data