Add AST cache for AdminLogsTest.php with extracted nodes and edges

This commit is contained in:
hamed
2026-07-10 09:48:45 +03:30
parent 9d2023a72f
commit 11efed4100
13 changed files with 1133 additions and 791 deletions
+19
View File
@@ -1216,6 +1216,25 @@ Notes:
- `context` is a JSON string (or `null`); a `Throwable` in the context is stored as a compact `Class: message @ file:line` string, never the raw object.
- `created_at` is a Unix timestamp (integer).
### GET `/api/v1/admin/logs/export`
Export **all** matching logs as a CSV file (no pagination). Respects the same `level`, `search`, `from`, `to` filters as the list endpoint. Ordered newest first (`id DESC`).
**Permission:** `ROLE_ADMIN`
### Query Parameters
| Param | Type | Required | Description |
|-------|------|----------|-------------|
| `level` | string | ❌ | Exact PSR level: `warning`, `error`, `critical`, `alert`, `emergency` |
| `search` | string | ❌ | Substring match on the message |
| `from` | integer | ❌ | Unix timestamp lower bound (`created_at >=`) |
| `to` | integer | ❌ | Unix timestamp upper bound (`created_at <=`) |
#### Response `200`
- `Content-Type: text/csv; charset=UTF-8`
- `Content-Disposition: attachment; filename="logs-YYYYMMDD-HHMMSS.csv"`
- Streamed CSV with a UTF-8 BOM (Excel-friendly for Persian). Columns: `id, level, message, context, channel, path, created_at`. `created_at` is formatted as `Y-m-d H:i:s`.
### DELETE `/api/v1/admin/logs`
Delete **all** persisted logs (truncate the `app_log` table). Irreversible.