Audit Log
Navigate to SwitchGuard → Audit Log.
Every switch event is recorded automatically. The log cannot be edited from the UI - it is append-only.
Log Columns
| Column | Description |
|---|---|
| ID | Auto-increment log entry ID |
| Event | switch_to, switch_back, switch_off, auto_switch_back |
| Switcher | User who initiated the switch (name + ID) |
| Target | User who was switched to (name + ID) |
| IP Address | Switcher's IP address at time of event |
| User Agent | Browser/client user-agent string |
| Timestamp | Date and time of the event |
Log Settings
| Setting | Default | Description |
|---|---|---|
| Retention Days | 30 | Audit records older than this are deleted by the daily cron |
The daily cleanup cron runs switchguard_daily_cleanup and purges records older than the retention period.
Exporting the Log
Click Export CSV in the Audit Log screen to download all records in the current filtered view as a CSV file. Useful for compliance reporting.
The log is stored in the {prefix}switchguard_log WordPress database table. Database-level access by a privileged admin could modify records. For tamper-proof audit trails, pipe the switchguard_switched action to an external log service.