Repository navigation
Description
Part of EPIC #2758. Order 7 of 11, wave 1.
Goal
The daemon writes its tracing output as JSON lines on stderr by default and reports a startup failure as a JSON record, as the contract requires of a no-stdout-result daemon.
Background
packages/configuration/src/v3_0_0/logging.rs (and the older versions and src/logging.rs) initialize tracing_subscriber::fmt() with with_test_writer() and ANSI, which writes to stdout in the full style by default (trace_style, default Full). src/main.rs reports startup failure with eprintln!("Tracker startup failed: {error}"). The contract requires tracing on stderr as NDJSON, nothing on stdout. Maintainer decision (2026-11-06): migrate now, not deferred. This is operator-visible just after the 3.0.0 release: deployments that parse the plain text or read stdout break. The trace_style option and config schema versions are public, so decide the migration detail with the maintainer before writing code (default json versus keeping trace_style meaning, stream, ANSI, deprecation of the other styles, versioned-config handling) and record it, with an ADR if it is a material decision. The e2e runner parses the container logs in src/console/ci/e2e/logs_parser.rs; that parser must follow the new format. Search for other readers of log text (docs/benchmarking.md, container docs, tests with with_test_writer).
The contract in short: see the ADRs docs/adrs/20260519000000_define_global_cli_output_contract.md and docs/adrs/20261106102632_scope_the_cli_output_contract_and_keep_exit_codes_to_zero_one_two.md.
In scope
- Send
tracingoutput to stderr; leave stdout empty. - Make JSON the default style (or the agreed alternative) and keep the other
trace_stylevalues only if the decision keeps them. - Startup failure as one JSON record on stderr, exit
1; usage and config errors exit2if they are usage errors. - Update
logs_parser.rsand its tests; update docs, default configs and the changelog or release-note convention. - Keep test-helper logging working (
packages/test-helpers/src/logging.rs).
Out of scope
- The e2e runners' own logging (EPIC issue 10).
- Changing log levels or thresholds.
Acceptance criteria
- Running the tracker writes nothing to stdout.
- Every stderr line is a JSON object.
- A startup failure prints one JSON record and exits
1. logs_parser.rsand its tests follow the new format.- The operator-visible change is documented.
The full specification (implementation plan, verification plan, files this issue may touch) is added by the spec PR under docs/issues/open/.
Activity
Merge #2771: docs(issues): [#2758] add the specs of the CLI output co…
docs(issues): [torrust#2387] number the sub-issues of the lifecycle l…
Merge #3007: docs(issues): [#2758] add #3004 and #3006 to the EPIC an…
docs(issues): [#2387] say that the daemon JSON logging issue starts a…
docs(issues): [#2387] record order B′ and recheck the EPIC specs agai…
Merge #3024: docs(issues): [#2387] record order B′ and recheck the EP…
docs(issues): [torrust#2758] start torrust#2766 after torrust#2387 SI…
Merge #3027: docs(issues): [#2758] start #2766 after #2387 SI-1 inste…
docs(issues): [torrust#2766] make the reserved-key rule of the JSON f…
docs(issues): [torrust#2766] exit 1, not 101, when a panic unwinds ou…
docs(issues): [torrust#2766] align the planned 4.0.0 changes section …
docs(issues): [torrust#2766] say that a text style still gives a mixe…
docs(issues): [torrust#2766] update the daemon logging risk of the EP…
20 remaining items
docs(pr-reviews): [torrust#2766] record the first review round on pul…
docs(issues): [torrust#2766] correct the commands that start and stop…
docs(pr-reviews): [torrust#2766] record the follow-up of the second r…
docs(issues): [torrust#2766] bound the wait for the listener in the r…
docs(pr-reviews): [torrust#2766] record the bounded wait finding of C…
docs(issues): [torrust#2766] replace the readiness wait of the reprod…
docs(pr-reviews): [torrust#2766] record the failed wait finding of Co…
docs(pr-reviews): [torrust#2766] record the re-raise of the failed wa…
perf(bootstrap): [torrust#2766] tell only the applied style about the…
test(bootstrap): [torrust#2766] assert the layout that only the full …
test(bootstrap): [torrust#2766] pin that a level change also reaches …
docs(bootstrap): [torrust#2766] show in the bootstrap docs that the e…
docs(issues): [torrust#2766] note in two live specs that the logging …
docs(issues): [torrust#2766] record the four styles after the logging…
docs(pr-reviews): [torrust#2766] record the review of da2ce7 on pull …