[go: up one dir, main page]

Add RPC to reconfigure event logging

Context

See issue #1075.

This does not touch the legacy logging for now, but allows to the reconfigure file-descriptor-path://.. sinks at will.

Manually testing the MR

Start a sandbox: rlwrap tezos-sandbox mini --size 1

At the prompt (or tezos-client or curl):

c0 rpc put /config/logging with "{ \"active_sinks\": [ \"file-descriptor-path:///tmp/node?level-at-least=info&format=pp\"]}"

And look at /tmp/node; some pretty-printed logs should show up.

Then,

c0 rpc put /config/logging with "{ \"active_sinks\": [ \"file-descriptor-path:///tmp/node?level-at-least=debug&fresh=true\"]}"

and now /tmp/node should be getting tons of JSON debug noise.

c0 rpc put /config/logging with "{ \"active_sinks\": [ \"file-descriptor-path:///tmp/node?level-at-least=debug\", \"file-descriptor-path:///tmp/node2?level-at-least=notice&format=pp\" ]}"

/tmp/node should still get a ton of JSON, but /tmp/node2 is now also there and should be quieter.

Start logging all and only the rpc section events:

c0 rpc put /config/logging with "{ \"active_sinks\": [ \"file-descriptor-path:///tmp/node?section-prefix=rpc:debug&format=pp&fresh=true\"]}"

This whole time the legacy-logging output at /tmp/mininet-test/node-N000/node-output.log has been growing steadily …

Checklist

  • Document the interface of any function added or modified (see the coding guidelines)
  • Provide automatic testing (see the testing guide).
  • Add item in the Development Version section of CHANGES.md (only for new features and bug fixes).

Reviewers

@klakplok @abate @pirbo

Edited by Seb Mondet

Merge request reports

Loading