#35387 logging: make trace logging easily usable
| Reviewability | Reviews | Agreement | Size | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| #35387 logging: make trace logging easily usable | Waiting on author | 0 | Mild | 188 + 102 tests | ||||||
|
|
|
|
| ||||||
Reviewability: ReadyStalePaused Agreement: StrongPositivePositive w/ caveatsNeutralMildDisputedBlockedCrickets Reviews: current code-review ACKs, then (+stale ACKs) and -NACKs; greener = more ACKs. Size: lines added or modified outside tests, then in tests; greener = smaller. | ||||||||||
Goal
This PR allows the -loglevel configuration option to function standalone without requiring accompanying -debug options to activate categories. It also introduces a new `loglevel` RPC that enables inspecting and adjusting logging levels (trace, debug, info) per category at runtime without restarting bitcoind.
Problem: Trace logging is difficult to discover and enable because -loglevel requires paired -debug flags to take effect. Furthermore, log severity thresholds cannot be modified dynamically at runtime, hindering debugging on live nodes.
Reviewability
Paused · Waiting on author
Open objections from cyb3ralbert, stickies-v with no author reply for 18 days; review would repeat what has been asked.
Waiting on (from the thread read):
- author: response to stickies-v's review and suggestions, and cyb3ralbert's questions regarding -debug compatibility 2026-10-14
Agreement
Mild
objection that needs an answer has none yet (stickies-v)
Thread notes: Added cyb3ralbert's comment c:6161400215 questioning the change in behavior between -debug and -loglevel contrary to the description's backwards-compatibility claim; cyb3ralbert also agreed with stickies-v's suggestion on config precedence.
Objections, suggestions, and questions:
| Reviewer | Type | Harm, request, or question | Status | Must be | Author replied | Quote |
|---|---|---|---|---|---|---|
| stickies-v (member) | objection, interface | maintaining two parallel active logging RPC methods adds interface redundancy and maintenance burden | open | answered | no | 2026-05-27: 'I don't think we should have 2 parallel active logging RPC methods, so imo this PR should mark logging deprecated' |
| stickies-v (member) | suggestion, approach | reference #34038 as an alternative in the PR description | open | answered | no | 2026-05-27: 'The PR description should probably reference #34038 as an alternativate?' |
| stickies-v (member) | suggestion, interface | split the loglevel RPC into separate getlogconfig (read) and setloglevel (single-change write) methods | open | answered | no | 2026-10-07: 'I think this RPC would be easier to use and reason about if we split it into a read and a write method, where the write method makes a single change per call' |
| stickies-v (member) | suggestion, approach | make -loglevel declarative at startup so category:level always overrides a global level regardless of order or source | open | answered | no | 2026-10-07: 'At startup, I think it makes sense for `-loglevel` to be declarative (unlike the RPC, which is imperative).' |
| cyb3ralbert (contributor) | question, correctness | ask if breaking -debug interactions when combined with global -loglevel is intended, and if so to document it and remove backwards compatibility claims | open | answered | no | 2026-10-14: 'With this PR a global `-loglevel` token enables or disables all categories and overrides `-debug`... Is this intended? If so, could the release notes mention it and the description drop "backwards compatible"?' |
Support:
- stickies-v (member) (2026-05-27) [read]: This looks like an elegant approach, I think it's an intuitive RPC and -loglevel interface.
Participants:
- stickies-v (member, objection, 4 statements 2026-05-27 to 2026-10-07): supports the approach and interface, but objects to having two parallel active logging RPC methods; suggested splitting loglevel RPC and making startup -loglevel declarative
- sedited (member, neutral, 1 statements 2026-10-02 to 2026-10-02): prompted author to respond to stickies-v's review
- cyb3ralbert (contributor, question, 1 statements 2026-10-14 to 2026-10-14): tested PR, asked about backwards compatibility and -debug/-loglevel interactions, agreed with stickies-v on config precedence
Files
104 lines under test/bench/ci.
- src/rpc/node.cpp +95/-19
- test/functional/feature_logging.py +100/-2
- src/init/common.cpp +44/-12
- doc/release-notes-35387.md +27/-0
- src/logging.cpp +14/-2
- src/logging.h +5/-6
- src/init.cpp +1/-0
- src/init/common.h +1/-0
- src/rpc/client.cpp +1/-0
- src/test/fuzz/rpc.cpp +1/-0
- src/test/logging_tests.cpp +1/-0
Card
The short text the ranking pass compares across PRs.
This PR simplifies trace logging configuration by allowing the -loglevel argument to enable logging categories directly without requiring paired -debug arguments, and introduces a new loglevel RPC to adjust category log levels at runtime. It solves developer and operator friction when inspecting trace-level details on running nodes without needing a restart. Reviewer stickies-v found the approach elegant, though suggested deprecating the legacy logging RPC and pointed out the competing alternative in #34038. The PR is technically ready with green CI, but the author has been silent for over 60 days.
Data
thread read through 2026-10-14 (7 statements), head dffb8cf9e7
labels: none
Categories
RPC / REST / ZMQ
P3 · new feature (ranking pass: Moved up 5: same band and same problem as #34038, kept adjacent so the two approaches are compared, but second since #34038 has a dependent PR.)
The PR introduces a new `loglevel` RPC to inspect and configure logging levels at runtime, but lacks evidence of external downstream consumer requests.
Membership: Adds a new `loglevel` JSON-RPC method in src/rpc/node.cpp for dynamic log inspection and adjustment.
Factors: security/stability 0, bug 0, performance 0, user value 1, leverage 0
Utilities (logging, arguments, libraries)
P3 · new feature (ranking pass: Placed next to #34038 because both solve the same trace-logging configuration problem and must be decided together.)
Allowing `-loglevel` to function standalone and enabling runtime log adjustments resolves confusing option coupling and aids node debugging.
Membership: Changes logging configuration options and runtime handling in src/logging.cpp and src/init/common.cpp.
Factors: security/stability 0, bug 0, performance 0, user value 1, leverage 0