2

According to the help page for the tezos-node you can pass -vv to get logs at the debug level. I'm looking to see the request body, response, and status codes in the RPC logs but that information doesn't seem to be available at the most verbose log level. Is there a way to get this information from the tezos-node output?

0

I use -l with tezos-client to see all HTTP interactions. For tezos-node, you probably need to run export TEZOS_LOG='* -> debug' before running node. That will create insane logs, however. Maybe 'rpc.* -> debug' would restrict it.

You can also edit ~/.tezos-node/config.json and add a section log:{} for more fine-grained tuning. Check ./tezos-node config --help

DEBUG
       The environment variable TEZOS_LOG is used to fine-tune what is going
       to be logged. The syntax is TEZOS_LOG='<section> -> <level> [ ; ...]'
       where section is one of 000-Ps9mPmXa 001-PtCJ7pwo 002-PsYLVpVv
       003-PsddFKi3 004-Pt24m4xi 005-PsBABY5H 005-PsBabyM1 006-PsCARTHA
       007-PsDELPH1 alpha base db demo-counter demo-noops genesis
       genesis-carthagenet node node.chain_validator
       node.distributed_db.p2p_reader node.distributed_db.requester node.main
       node.protocol_store node.requester.scheduler node.shutdown node.state
       node.storage_consistency node.validator node.validator.block
       node.validator.bootstrap_pipeline node.worker p2p p2p.conn
       p2p.connect_handler p2p.connection p2p.discovery p2p.fd
       p2p.io-scheduler p2p.maintenance p2p.pool p2p.protocol p2p.welcome rpc
       updater validator.block validator.chain validator.peer and level is one
       of fatal, error, warn, notice, info or debug. A * can be used as a
       wildcard in sections, i.e.  client* -> debug. The rules are matched
       left to right, therefore the leftmost rule is highest priority .
2
  • Thanks @utdrmac. -vv turns on the debug level logging that you're suggesting. Unfortunately in this case we are trying to debug an issue with an application that is hard to reproduce which makes the -l in the tezos-client or the -v with curl not usable. Dec 15 '20 at 17:34
  • Just to give an example. We have two users, using our node getting "michelson_v1.invalid_constant" while trying to use our mobile app. Nobody can reproduce the issue. We are looking to see can we log, from the node, all the JSON requests and responses so we can search for this error, to see what the user sent. And try debug it backwards from there. Is there a way to do that? Dec 15 '20 at 17:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.