Skip to content

Release b517

Choose a tag to compare

@github-actions github-actions released this 17 Sep 09:44

feat(dashboard): fill the error log view by tailing today's error log file

Non-2xx responses and interrupted SSE streams never reach the records table:
process_non_streaming_response only persists 2xx, and a stream that dies after
the 200 header is already committed logs to error.log instead. So the 错误日志
filter had nothing to show. The page now reads the log file directly.

  • error_log_api: GET /dashboard/api/error-log returns the newest error..log
    walked backwards in 64 KiB chunks, so cost scales with the page size rather
    than the log size. Each response carries nextBefore, the byte offset of the
    oldest returned line, which is always a line boundary; the reader reads one
    byte before the offset to detect and discard a truncated leading line, and
    drops a trailing partial line when the offset is not at EOF.
  • The handler runs the file walk on spawn_blocking so the async runtime is
    never blocked by disk I/O.
  • logging: DEFAULT_LOG_DIR is now shared with LogConfig::default so the reader
    and the writer cannot drift onto different directories.
  • records.html: 错误日志 switches the panel to a monospace log view with
    cursor-based 上一页/下一页 and the shared 20/50/100/200 page size; the record
    filters are hidden there since they do not apply to file lines. The tags-like
    meta line names the file being read.

Verified: 175 unit tests (5 new cover newest-first ordering, gap-free backwards
paging, a missing trailing newline, an empty file and date selection), full
suite 48 passed / 0 failed, and a browser pass over 55 synthetic lines paging
20/20/15 with no overlap, no gaps, 上一页/下一页 state correct, and a clean
switch back to 推理日志.