[GH-ISSUE #1177] Feature request: add timestamps to engine log lines #488

Closed
opened 2026-11-04 01:43:27 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Ryutaku on GitHub (Oct 6, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1177

Problem

The engine's log lines carry no timestamps. Every line in strata.log (the file pointed to by "log" in strata-<model>.json) is written as-is to stderr with no time prefix, so a log of a long-running serve gives no way to tell when a request, a restart, a cache hit, a stall, or a crash happened.

This is not hypothetical - it already bit a field report. In #980 the author had to reconstruct time windows by "server restarts matched to config backups and scheduler logs", because the Strata log itself gave no time information:

The Strata log lines have no timestamps. The windows come from server restarts matched to config backups and scheduler logs.

For anyone diagnosing a stall, a watchdog fire (#29), a crash (#795, #779), a deadlock (#481), or a cache miss (#1128, #143), the first thing they do is paste a log excerpt - and the excerpt has no clock, so the maintainer cannot tell which lines belong to which run, which request, or which minute.

Current state

  • The engine writes to stderr; the server redirects stderr to the log file (serve/server.py:608).
  • The only timestamped line is the server's own start marker, hardcoded at serve/server.py:602:
    [strata] YYYY-MM-DD HH:MM:SS engine started: ...
  • There is no --log-prefix, --no-log-prefix, --color, --log-disable, --verbose, or any format knob in src/program/generate.cpp's argument parser. llama.cpp has these; Strata dropped them.

Proposal

  1. Prefix every engine log line with [YYYY-MM-DD HH:MM:SS] (local time, ISO-ordered date) by default.
  2. Add a config key in strata-<model>.json (e.g. "log_prefix": true|false) and a CLI flag (--log-prefix / --no-log-prefix) to toggle it, so existing log parsers and the Monitor's log readers (serve/server.py:394, serve/server.py:449) are not broken for users who want the old format.
  3. Keep the format fixed and machine-parseable (no color codes in the file; color only on a TTY if --color is added later).

Why it matters

  • Crash/stall reports become self-describing: the time of the last line before a hang is the time of the hang.
  • Cross-referencing with OS event logs, scheduler logs, and /metrics becomes a one-line join instead of manual archaeology.
  • Cost is trivial: one strftime per line, behind a flag.

Notes

  • The server's own [strata] ... start line at serve/server.py:602 already uses this format, so the engine prefix would match it.
  • The Monitor and narrate_start read the log by byte offset, not by parsing timestamps, so adding a prefix does not break them.
Originally created by @Ryutaku on GitHub (Oct 6, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/1177 ## Problem The engine's log lines carry no timestamps. Every line in `strata.log` (the file pointed to by `"log"` in `strata-<model>.json`) is written as-is to stderr with no time prefix, so a log of a long-running serve gives no way to tell *when* a request, a restart, a cache hit, a stall, or a crash happened. This is not hypothetical - it already bit a field report. In #980 the author had to reconstruct time windows by "server restarts matched to config backups and scheduler logs", because the Strata log itself gave no time information: > The Strata log lines have no timestamps. The windows come from server restarts matched to config backups and scheduler logs. For anyone diagnosing a stall, a watchdog fire (#29), a crash (#795, #779), a deadlock (#481), or a cache miss (#1128, #143), the first thing they do is paste a log excerpt - and the excerpt has no clock, so the maintainer cannot tell which lines belong to which run, which request, or which minute. ## Current state - The engine writes to stderr; the server redirects stderr to the log file (`serve/server.py:608`). - The only timestamped line is the server's own start marker, hardcoded at `serve/server.py:602`: `[strata] YYYY-MM-DD HH:MM:SS engine started: ...` - There is no `--log-prefix`, `--no-log-prefix`, `--color`, `--log-disable`, `--verbose`, or any format knob in `src/program/generate.cpp`'s argument parser. llama.cpp has these; Strata dropped them. ## Proposal 1. Prefix every engine log line with `[YYYY-MM-DD HH:MM:SS]` (local time, ISO-ordered date) by default. 2. Add a config key in `strata-<model>.json` (e.g. `"log_prefix": true|false`) and a CLI flag (`--log-prefix` / `--no-log-prefix`) to toggle it, so existing log parsers and the Monitor's log readers (`serve/server.py:394`, `serve/server.py:449`) are not broken for users who want the old format. 3. Keep the format fixed and machine-parseable (no color codes in the file; color only on a TTY if `--color` is added later). ## Why it matters - Crash/stall reports become self-describing: the time of the last line before a hang is the time of the hang. - Cross-referencing with OS event logs, scheduler logs, and `/metrics` becomes a one-line join instead of manual archaeology. - Cost is trivial: one `strftime` per line, behind a flag. ## Notes - The server's own `[strata] ...` start line at `serve/server.py:602` already uses this format, so the engine prefix would match it. - The Monitor and `narrate_start` read the log by byte offset, not by parsing timestamps, so adding a prefix does not break them.
Author
Owner

@Niko1221 commented on GitHub (Oct 13, 2026):

Thanks for the report. To keep the tracker current we are closing issues older than three days: 0.1.44 is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1.

If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.

<!-- gh-comment-id:6156028105 --> @Niko1221 commented on GitHub (Oct 13, 2026): Thanks for the report. To keep the tracker current we are closing issues older than three days: [0.1.44](https://github.com/Niko1221/Strata/releases/tag/v0.1.44) is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1. If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#488
No description provided.