waku-org / nwaku

Waku node and protocol.
Other
200 stars 53 forks source link

General log clean-up #983

Open jm-clius opened 2 years ago

jm-clius commented 2 years ago

Background

Most nwaku nodes run with DEBUG level logs.

Although this is a useful (and necessary) log level for debugging purposes, the logs are very noisy even under stable operation, making it difficult to find and investigate unusual conditions

Very frequent logs should either be lowered to TRACE level or filtered.

Examples of frequent logs

These can be individually investigated and filtered/suppressed:

DBG 2022-05-31 10:06:24.129+00:00 Accepted an incoming connection            topics="libp2p switch" tid=1 file=switch.nim:203 conn=:6295e8a094fbd5702e8ffc07
DBG 2022-05-31 10:06:24.130+00:00 Exception upgrading incoming               topics="libp2p muxedupgrade" tid=1 file=muxedupgrade.nim:155 exc="Stream EOF!"

On systems with RLN enabled:

DBG 2022-05-31 09:18:54.305+00:00 rln-relay topic validator is called        topics="wakunode" tid=1 file=wakunode2.nim:499
DBG 2022-05-31 09:18:54.306+00:00 content topic did not match:               topics="wakunode" tid=1 file=wakunode2.nim:508 contentTopic=/railgun/v1/137/fees/json payload="{"data":"7b2266656573223a7b22307830643530306231643865386566333165323163393964316462396136343434643361646631323730223a22307830666635396565383333623330303030222c22307832373931626361316632646534363631656438386133306339396137613934343961613834313734223a223078306239336...
LNSD commented 2 years ago

I think that it would be interesting to define a set of rules to choose the right logging level. Defining these rules will help us to have consistent logging. I think this should be part of the acceptance criteria for this issue.

For example, for warn level what makes sense for me is (from: https://github.com/status-im/nwaku/pull/991#issuecomment-1145902891):

For example, I would set it to warn level in the case that reaching that state was non-critical and uncommon but could affect the app stability.

Let's not forget that proper (and well-thought) logging is a basic tool for debugging in production environments 😁

jm-clius commented 2 years ago

Also investigate, first reported in https://github.com/status-im/nwaku/issues/703

failed to store peers topics="wakupeers" tid=1 file=peer_manager.nim:44 err="failed to encode: Failed to encode public key"