IntersectMBO / cardano-node

The core component that is used to participate in a Cardano decentralised blockchain.
https://cardano.org
Apache License 2.0
3.06k stars 723 forks source link

cardano-node should improve logging clarity #4630

Open sunapi386 opened 1 year ago

sunapi386 commented 1 year ago

Internal/External External otherwise.

Area Other Any other topic (Delegation, Ranking, ...).

Summary Cardano-node logs include too much unnecessary haskell data-structure specific information. This is bad because it is increases log size without providing any additional value.

E.g.

Nov 10 12:13:07 relay1 cardano-node[66273]: [relay1:cardano.node.Mempool:Info:207475] [2022-11-10 20:13:07.06 UTC] fromList [("kind",String "TraceMempoolAddedTx"),("mempoolSize",Object (fromList [("bytes",Number 36322.0),("numTxs",Number 21.0)])),("tx",Object (fromList [("txid",String "879588a7")]))]
Nov 10 12:13:08 relay1 cardano-node[66273]: [relay1:cardano.node.LeadershipCheck:Info:154] [2022-11-10 20:13:08.00 UTC] {"chainDensity":4.8895936e-2,"credentials":"Cardano","delegMapSize":1226822,"kind":"TraceStartLeadershipCheck","slot":76544897,"utxoSize":8906282}
Nov 10 12:13:08 relay1 cardano-node[66273]: [relay1:cardano.node.Forge:Info:154] [2022-11-10 20:13:08.02 UTC] fromList [("credentials",String "Cardano"),("val",Object (fromList [("kind",String "TraceNodeNotLeader"),("slot",Number 7.6544897e7)]))]
Nov 10 12:13:09 relay1 cardano-node[66273]: [relay1:cardano.node.LeadershipCheck:Info:154] [2022-11-10 20:13:09.00 UTC] {"chainDensity":4.8895936e-2,"credentials":"Cardano","delegMapSize":1226822,"kind":"TraceStartLeadershipCheck","slot":76544898,"utxoSize":8906282}
Nov 10 12:13:09 relay1 cardano-node[66273]: [relay1:cardano.node.Forge:Info:154] [2022-11-10 20:13:09.02 UTC] fromList [("credentials",String "Cardano"),("val",Object (fromList [("kind",String "TraceNodeNotLeader"),("slot",Number 7.6544898e7)]))]
Nov 10 12:13:09 relay1 cardano-node[66273]: [relay1:cardano.node.Mempool:Info:207475] [2022-11-10 20:13:09.92 UTC] fromList [("kind",String "TraceMempoolAddedTx"),("mempoolSize",Object (fromList [("bytes",Number 41599.0),("numTxs",Number 22.0)])),("tx",Object (fromList [("txid",String "bc6ac097")]))]

Steps to reproduce Steps to reproduce the behavior:

  1. Run cardano-node.
  2. View the logs.

Expected behavior I hope the logs reduce the amount printed and improve readability overall.

System info (please complete the following information):

coot commented 1 year ago

@sunapi386 I aggree, especially we should not use show for data which contains Value (which is an intermediate representation of json in Haskell).

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 120 days.

erikd commented 1 year ago

I think this needs to be kept alive.