Issues / #1177
#1177 Feature request: add timestamps to engine log lines
open · @Ryutaku · 0 comentarios · En GitHub
Descripción
## 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.
En el sitio
Enlaces a install, modelos, releases.