You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
id(structured-logging): an unrecognized ID_LOG_FORMAT silently resolves to text — no fallback warning, unlike ID_LOG_TZ #5434
An unrecognized ID_LOG_FORMAT value silently resolves to text logging, with no warning anywhere — unlike the neighbouring ID_LOG_TZ knob, whose unrecognized values fall back to UTC and warn, by design.
Evidence (verified this run, main 0ab687345)
pkgs/id/src/structured_logging.rs — LogFormat::parse: "anything unrecognized is Text". Probe on the laptop (~/git/fleet/probe-logformat, the function extracted verbatim) printed:
ID_LOG_FORMAT=Some("josn") -> Text
ID_LOG_FORMAT=Some("jsonl") -> Text
ID_LOG_FORMAT=Some("structured") -> Text
ID_LOG_FORMAT=Some("yaml") -> Text
LogConfig (same file) carries a tz_fell_back: bool for the timezone knob but no equivalent flag for the format — the information that the value was unrecognized is discarded inside parse.
pkgs/id/src/main.rsinit_logging (line ~99) warns on stderr for config.tz_fell_back ("warning: ID_LOG_TZ value not recognized; log timestamps use UTC") and for a log file that cannot be opened, but has nothing to warn about for format, because the flag does not exist.
The module header documents the tz behaviour as the designed pattern: "an unrecognized value falls back to UTC and the caller warns about the fallback."
Why it matters
An operator who sets ID_LOG_FORMAT=josn (or jsonl, or any near-miss) while wiring logs into a JSON ingester gets plain-text logs and no signal at any point — the exact silent-misconfiguration failure the tz fallback warning exists to prevent. The two knobs sit side by side in the same config struct and the same doc block; only one of them warns.
Acceptance criteria
LogConfig records whether a set, non-emptyID_LOG_FORMAT value was unrecognized (unset/empty/text/json, case-insensitive after trim, never set the flag — mirroring how unset/empty tz never sets tz_fell_back).
init_logging in pkgs/id/src/main.rs prints a stderr warning naming ID_LOG_FORMAT when the flag is set, in the same style as the existing ID_LOG_TZ warning, before tracing starts.
The resolved format itself is unchanged: unrecognized values still resolve to Text (no behaviour break for anyone relying on the lenient parse).
Tests in structured_logging.rs pin the table: recognized values and unset/empty leave the flag clear; josn/yaml set it while still resolving to Text.
Task: Filed after verifying on the laptop (probe ~/git/fleet/probe-logformat, LogFormat::parse extracted verbatim from main 0ab687345): every unrecognized non-empty ID_LOG_FORMAT resolves to Text, LogConfig carries tz_fell_back but no format equivalent, and init_logging warns only for the tz fallback. Guarded self-solve this run (protocol §4): the fix is trivial and clearly scoped — a format_fell_back flag on LogConfig, the mirroring stderr warning in init_logging, and pinning tests. No queue packet is enqueued for this issue; it is held via work/self-assigned.
Expectation: effort xs; done = PR merged with the flag + warning + tests, targeted structured_logging tests green on the laptop.
Links: body evidence in the issue; branch creator-a/5434-logformat-fallback-warning (PR to follow)
Expectation: done — cargo test -p id --lib structured_logging 13 passed on the laptop (incl. the new pinning test), cargo check -p id --bins clean; work labels stripped with this note.
Activity
developing-today commentedon Nov 4, 2026
CODE-1319
dezren39 commentedon Nov 4, 2026
🤖 Agent note · state: filed
~/git/fleet/probe-logformat,LogFormat::parseextracted verbatim from main0ab687345): every unrecognized non-emptyID_LOG_FORMATresolves to Text,LogConfigcarriestz_fell_backbut no format equivalent, andinit_loggingwarns only for the tz fallback. Guarded self-solve this run (protocol §4): the fix is trivial and clearly scoped — aformat_fell_backflag onLogConfig, the mirroring stderr warning ininit_logging, and pinning tests. No queue packet is enqueued for this issue; it is held viawork/self-assigned.structured_loggingtests green on the laptop.creator-a/5434-logformat-fallback-warning(PR to follow)fix(id): warn on unrecognized ID_LOG_FORMAT instead of silently using…
dezren39 commentedon Nov 4, 2026
🤖 Agent note · state: done
LogConfignow recordsformat_fell_backfor a set, non-empty, unrecognizedID_LOG_FORMAT, andinit_loggingwarns on stderr in the same style as theID_LOG_TZwarning. The lenient parse is unchanged (unrecognized values still resolve to Text).cargo test -p id --lib structured_logging13 passed on the laptop (incl. the new pinning test),cargo check -p id --binsclean; work labels stripped with this note.