1.6 KiB
1.6 KiB
id, name, status, depends_on, scope, risk, impact, level, review_findings
| id | name | status | depends_on | scope | risk | impact | level | review_findings | |
|---|---|---|---|---|---|---|---|---|---|
| fix/json-format-without-logfile | Fix JSON format not applied when no log file is configured (C4) | completed | single | trivial | isolated | implementation |
|
Description
When format = "json" is configured but no log_file_path is set, the None
branch of init_json creates a layer without calling .json(). The output
is plain text, not JSON. The format = "json" config value is silently ignored.
The spec (operations.md) states: "Both output destinations must respect the
format config value: when format = "json", both file and stdout output must
use JSON formatting."
Changes Required
src/logging/mod.rs — init_json function, None branch (lines 54-58):
- Add
.json()to the stdout-only layer:None => { let layer = tracing_subscriber::fmt::layer() .json() .with_ansi(false) .with_filter(env_filter); tracing_subscriber::registry().with(layer).try_init()?; }
Acceptance Criteria
.json()is called in theNonebranch ofinit_jsonformat = "json"with nolog_file_pathproduces JSON output on stdoutformat = "json"withlog_file_pathstill produces JSON on both outputsformat = "text"paths are unchangedcargo testpassescargo clippypasses with no warnings
References
- docs/architecture/operations.md — logging output, format guarantee
- docs/reviews/003-security-and-bug-review.md — C4 finding
- src/logging/mod.rs —
init_jsonfunction
Notes
To be filled on completion
Summary
To be filled on completion