algorand / algorand/go-algorand
Replace Logrus
- Lingua principale
- Go
- Stelle
- 1.4k
- Fork
- 537
- Merge medio
- 1g 6h
- PR unite (30g)
- 17
Descrizione
# Problem and Background
"we found our logrus logger is responsible for large REST API slowdown every time new blocks arrives or accounts are written"
Logrus is well known to be slow compared to other modern logging libraries, and is always included in benchmarks which show it to be trailing in performance:
* http://hackemist.com/logbench/
* https://github.com/uber-go/zap#performance
It is not disputable that we would see some performance gain by switching logging libraries, but it is not clear how much of that gain translates to networking and consensus improvements.
# Solution
Pick a new logging library. It should be fast and provide the necessary abstractions we need for things like sending errors to telemetry and whatever else our logging library does.
# Unknowns
How disruptive would it be if the logging format changes?
Are there other fancy things like sending errors to telemetry that the logging library needs to accomplish?
# Tasks
1. Write a test that measure performance with and without any logging, to understand the impact more clearly.
2. Select a new logging library (zerolog).
3. Configure logging output to match the logrus output as closely as possible.
4. Implement the logging interface using the new library, updating interface as necessary.
5. Ensure errors are forwarded to telemetry
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.