Closed rem1-dev closed 9 months ago
I was thinking that it might be useful to log two extra things - the jsonrpc id
field so that the rpc request
and rpc response
entries can be matched to each-other, and the time it took to process the request.
I'm not sure whether these are necessary or not. If not, we can go ahead and merge.
Yes, it's good idea to add id into req and resp logs. Did you mean id that we can get from cmd variable: cmd.get("id")
? I added that.
I made some minor formatting/refactoring suggestions and added the time duration for processing requests in a branch. What do you think?
It looks good to me. I also updated PR description to be more verbose on why we're adding it.
Great :) Can you apply the changes on your branch and rebase?
I applied your changes + I changed duration timestamp field to microseconds because when I tested it I never got duration > 1s and that field was always 0. Re rebase: not sure what should I rebase on. Branch is up-to date with new-index
Thanks!
I accidentally merged without squashing, looking into fixing this
Adding RPC related event logs that will be used in Blockstream Explorer project. The logs are structured as json object. This optional logging may be used in an enterprise/internal scenario for billing purposes. By default it's turned off.
The logs are controlled with a new
--rpc-logging
command line option. Command line option possible values, and example structured logs they produce, are as following:--rpc-logging full
results in logs:--rpc-logging no-params
excludes RPC request params to be logged, results in logs like: