告诉你为什么会发生的日志库
eliot的Python项目详细描述
python的内置logging和其他类似的系统输出了一系列factoid:它们很有趣,但是您无法真正知道发生了什么。
- 为什么你的申请很慢?
- 是什么原因导致选择了此代码路径?
- 为什么会发生这个错误?
标准日志无法回答这些问题。
但是,有了一个更好的模型,您就可以理解应用程序中发生了什么以及为什么发生了这些事情。 你可以找出性能瓶颈,你可以理解什么时候发生了什么,谁叫什么。
艾略特就是这么做的。 eliot是一个python日志系统,它输出actions的因果链:actions可以生成其他action,最终它们要么成功,要么失败。 生成的日志告诉您软件所做的事情:发生了什么,以及是什么导致了它。
Eliot支持一系列用例和第三方库:
- 在单个进程中记录。
- 分布式系统中的因果追踪。
- 科学计算,用built-in support for NumPy and Dask。
- Asyncio and Trio coroutines和Twisted networking framework。
Eliot仅用于生成日志;如果在多台计算机上使用多个进程,则可能需要LogStash和ElasticSearch等工具来聚合和存储日志。
Eliot支持Python3.5、3.6和3.7以及PyPy3。 它由Itamar Turner Trauring维护,并在Apache2.0许可下发布。
python 2.7处于遗留支持模式,支持的最后一个版本是1.7;有关详细信息,请参见here。
- Read the documentation。
- 从PyPI或conda-forge下载。
- 需要帮助还是有问题?File an issue在github上。
- 商业支持可从Python⇒Speed获得。
推荐信
“Eliot has made tracking down causes of failure (in complex external integrations and internal uses) tremendously easier. Our errors are logged to Sentry with the Eliot task UUID. That means we can go from a Sentry notification to a high-level trace of operations—with important metadata at each operation—in a few seconds. We immediately know which user did what in which part of the system.”
—Jonathan Jacobs