status-im / status-go

The Status module that consumes go-ethereum
https://status.im
Mozilla Public License 2.0
727 stars 249 forks source link

Make zap.Logger a central logger #6029

Closed osmaczko closed 18 hours ago

osmaczko commented 2 weeks ago

Description

In status-go, the usage of geth.Logger should be replaced with zap.Logger, and a custom handler should be created for the root geth.Logger to proxy logs to a zap.Logger instance named "geth." This will allow us to filter logs originating from there.

Context:

Logs in geth.log are incomplete; they do not include the logger name. This issue arises because we are propagating zap logs to the root geth.Logger, which results in the loss of some information. Additionally, this logging flow seems incorrect. Instead of zap.Logger->geth.Logger, it should likely be geth.Logger->zap.Logger (i.e., from a specific logger to a more generic one).

Notes

go-ethereum has updated its logging utility, and when we rebase our fork, we will need to use the SetDefault function instead of SetHandler.