Repository navigation
Commit f52fe19
feat(dashboard): export logs from the console and settings pages (#10418)
* feat(dashboard): export logs from the console and settings pages
Add GET /api/v1/logs/export, which packs the log files and the in-memory
logs into a zip archive. The files come from StorageCleaner, so log and
trace log paths configured outside data/logs are included too, and the
in-memory cache is split into memory/logs.txt and memory/traces.jsonl.
Add an Export Logs button to the console page and to the log and cache
cleanup panel in Settings.
Closes #10407
* feat(dashboard): skip non-regular files and add a manifest to log exports
Only pack regular files, so a symlink in a log directory cannot pull in a
file from elsewhere and a FIFO cannot block the export. Skipped files and
files that disappear while packing are listed in manifest.json with the
reason, together with the AstrBot version and the in-memory log counts.
Also keep same-named log files from different directories apart, and
remove archives left behind by cancelled downloads.
* fix(dashboard): harden log export against swapped files and disk use
Open each log file without following symlinks or blocking on FIFOs and
check the opened descriptor, so a file swapped after the lstat() check
cannot get into the archive. Run one export at a time and check the free
temp space before packing.
Reserve the generated archive entries and dedupe every file name, move
the temp directory setup into the handled block, and say in the tooltip
and docs that without file logging the archive mostly has in-memory logs,
since older log files on disk are still included.
* feat(dashboard): unify diagnostic and log export
---------
Co-authored-by: advent259141 <2968474907@qq.com>1 parent f2404c1 commit f52fe19
20 files changed
Lines changed: 1413 additions & 17 deletions
File tree
- astrbot
- core/utils
- dashboard
- api
- services
- dashboard/src
- api
- generated/openapi-v1
- i18n/locales
- en-US/features
- ja-JP/features
- ru-RU/features
- zh-CN/features
- views
- docs
- en/use
- zh/use
- openspec
- tests
- unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
85 | | - | |
| 86 | + | |
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| |||
130 | 131 | | |
131 | 132 | | |
132 | 133 | | |
133 | | - | |
| 134 | + | |
134 | 135 | | |
135 | 136 | | |
136 | 137 | | |
| |||
188 | 189 | | |
189 | 190 | | |
190 | 191 | | |
191 | | - | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
192 | 199 | | |
193 | 200 | | |
194 | 201 | | |
| |||
208 | 215 | | |
209 | 216 | | |
210 | 217 | | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
211 | 221 | | |
212 | 222 | | |
213 | 223 | | |
214 | | - | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
215 | 233 | | |
216 | 234 | | |
217 | 235 | | |
| |||
281 | 299 | | |
282 | 300 | | |
283 | 301 | | |
284 | | - | |
285 | | - | |
| 302 | + | |
| 303 | + | |
286 | 304 | | |
287 | 305 | | |
288 | 306 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
3 | 6 | | |
4 | | - | |
| 7 | + | |
| 8 | + | |
5 | 9 | | |
6 | 10 | | |
7 | 11 | | |
| |||
80 | 84 | | |
81 | 85 | | |
82 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
83 | 106 | | |
84 | 107 | | |
85 | 108 | | |
| |||
0 commit comments