Audit Logs
ZestSSH maintains a database-backed audit trail of all automation executions. This provides visibility into headless SSH operations triggered by external automation apps (Tasker, MacroDroid, iOS Shortcuts) or internal workflows.
What’s Logged
Section titled “What’s Logged”Every automation execution creates an AutomationHistory entry with the following fields:
| Field | Type | Description |
|---|---|---|
id | Text | Unique identifier for the entry |
timestamp | DateTime | When the execution occurred |
action | Text | Action type (see below) |
connectionId | Text | Connection label or ID that was targeted |
command | Text | The command executed, snippet name, or workflow name |
snippetName | Text (nullable) | Snippet name, if the action was snippet |
stdout | Text | Command standard output |
stderr | Text | Command standard error output |
exitCode | Integer (nullable) | Process exit code (null if unavailable) |
success | Boolean | Whether the execution succeeded |
elapsedMs | Integer | Elapsed time in milliseconds |
Action Types
Section titled “Action Types”| Action | Trigger |
|---|---|
execute | Direct command execution via automation intent |
snippet | Named snippet triggered by automation |
batch | Batch execution of multiple commands |
connect | Connection establishment via automation |
workflow | Multi-step workflow execution |
Storage
Section titled “Storage”Audit logs are stored in the local SQLite database (Drift ORM) in the automation_history table. They are:
- Local only — Not synced to Cloud Sync (audit logs are device-specific).
- Not included in backups — Backup files contain connection data, not execution history.
- Capped at 500 entries — The
trim(500)method automatically removes the oldest entries when the cap is exceeded.
Viewing Audit Logs
Section titled “Viewing Audit Logs”- Go to Automation > History (accessible from the automation section in navigation).
- The history screen displays all entries sorted newest-first.
Each entry shows:
- Timestamp
- Action type with a visual indicator
- Target connection
- Command or snippet name
- Success/failure status
- Exit code (if available)
- Elapsed time
Tap an entry to see the full stdout and stderr output.
Search and Filter
Section titled “Search and Filter”The automation history screen supports:
- Search — Filter entries by connection name, command text, or snippet name.
- Filter by action type — Show only specific action types (execute, snippet, batch, connect, workflow).
- Filter by status — Show only successful or failed executions.
Cleanup Operations
Section titled “Cleanup Operations”Manual Clear
Section titled “Manual Clear”To delete all audit log entries:
- Go to Automation > History.
- Tap the clear/delete button.
- Confirm the deletion.
This calls deleteAll() on the AutomationHistoryDao.
Automatic Trimming
Section titled “Automatic Trimming”The trim(maxEntries) method keeps only the most recent entries:
- Fetches all entries sorted by timestamp (newest first).
- If the count exceeds
maxEntries, deletes everything beyond the limit. - The default cap is 500 entries.
Age-Based Cleanup
Section titled “Age-Based Cleanup”The deleteOlderThan(cutoff) method removes entries with a timestamp before the specified DateTime. This can be used for periodic cleanup of old entries.
Data Schema
Section titled “Data Schema”The AutomationHistory table is defined as a Drift table class with the following constraints:
actionfield has a length constraint of 1—32 characters.stdoutandstderrdefault to empty strings.exitCodeis nullable (not all operations produce an exit code).snippetNameis nullable (only populated for snippet actions).- Primary key is the
idfield.