Commit e292cdb
committed
feat(logs): capture request/response payloads and redesign log viewer
Backend:
- Extend request_logs schema with method, path, request_headers,
request_body, response_headers, response_body (SQLite + Postgres
migrations via ensure_request_log_column / ALTER TABLE IF NOT EXISTS)
- Capture ingress method/path/headers/body across universal, gemini and
embeddings proxy entrypoints; aggregate final JSON for streaming
responses and persist as response_body
- Emit logs on all early-exit error paths (decode failure, no route,
auth failure, upstream error, cache miss fallbacks) with full context
- Cache-hit paths now include complete request/response bodies
- Embeddings proxy: log every success/error branch and parse
usage.prompt_tokens into input_tokens
- Split API: query_logs list strips heavy fields (NULL bodies/headers);
new get_log(id) endpoint fetches full payload on demand
- Settings: DEFAULT_RETENTION_DAYS 30 -> 7, batch size 64 -> 32,
cleanup interval 60s -> 600s; new log_record_payloads toggle
(default true) to disable payload persistence
Frontend:
- Compact 7-column log list (Time / Status / Model / Protocol /
Latency / Token / Type), left-aligned, row click opens detail
- New LogDetailDialog with meta header and four copy-enabled payload
blocks (request headers/body, response headers/body) using lazy
get_log fetch and pretty-printed JSON
- Token display with IN/OUT labels and K/M formatting
(<1000 raw, <1M 1-decimal K, >=1M 2-decimal M)
- Type badge: green SSE / sky JSON replaces boolean stream column
- Settings: split Log Configuration into its own half-width card next
to Proxy Configuration; rename to "Retention Period" + "Record
Payloads" with HelpCircle tooltips; tighten Config Backup layout1 parent d141afa commit e292cdb
File tree
17 files changed
+1308
-275
lines changed- crates/nyro-core/src
- admin
- db
- logging
- proxy
- storage
- postgres
- sqlite
- src-server/src
- src-tauri/src
- webui/src
- components
- lib
- pages
17 files changed
+1308
-275
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
751 | 751 | | |
752 | 752 | | |
753 | 753 | | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
754 | 758 | | |
755 | 759 | | |
756 | 760 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
61 | 67 | | |
62 | 68 | | |
63 | 69 | | |
| |||
478 | 484 | | |
479 | 485 | | |
480 | 486 | | |
481 | | - | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
482 | 494 | | |
483 | 495 | | |
484 | 496 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
163 | 173 | | |
164 | 174 | | |
165 | 175 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
| |||
20 | 23 | | |
21 | 24 | | |
22 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
23 | 32 | | |
24 | 33 | | |
25 | 34 | | |
26 | | - | |
| 35 | + | |
27 | 36 | | |
28 | | - | |
| 37 | + | |
29 | 38 | | |
30 | 39 | | |
31 | 40 | | |
32 | 41 | | |
33 | 42 | | |
34 | | - | |
| 43 | + | |
35 | 44 | | |
36 | 45 | | |
37 | 46 | | |
| |||
50 | 59 | | |
51 | 60 | | |
52 | 61 | | |
53 | | - | |
| 62 | + | |
54 | 63 | | |
55 | 64 | | |
56 | 65 | | |
| |||
65 | 74 | | |
66 | 75 | | |
67 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
68 | 88 | | |
69 | | - | |
70 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
71 | 98 | | |
| 99 | + | |
| 100 | + | |
0 commit comments