在Github中stars数最多的Go日志库集合

在Go语言世界中,日志库并不像Java世界那里有一个具有统治力的日志库。在做新项目技术选型的时候,难免会遇到日志库的选择问题,今天笔者就为大家介绍一下在Github中stars数最多的Go日志库。

logrus是我已知的Go语言日志库中在Github中stars数最多的日志库,功能强大,性能也不错。另外值得一提的是logrus的一个fork库gogap/logrus,可以配置输出到文件和graylog日志系统,基础的level、调用链、行号,文件切分都有,特色是结构化日志可以被统计和索引,借助graylog就可以做日志分析,不过这个库很久没有维护了。

zap是Go中一个快速,结构化,分级日志库,Uber出品。能够激活强大的ad-hoc分析, 灵活的仪表板, 其功能超过其他工具ELK, Splunk, 和 Sentry. 所有日志消息都是JSON-serialized。也是目前笔者使用的日志库之一。

zerolog也是一款性能相当好的日志库,有趣的是zerologzap都在自家的Github库首页中的性能对比数据里打败了对方:)

Seelog是一个原生Go日志库,提供了灵活的异步调度、过滤和格式化。这也是笔者较早期使用的Go日志库之一。

blog4go是高性能日志库。创新地使用“边解析边输出”方法进行日志输出,同时支持回调函数、日志淘汰和配置文件。可以解决高并发,调用日志函数频繁的情境下,日志库造成的性能问题。

有一些Github库star数并不多,但是功能却很多,例如mkideal/loggo-logalog等就是功能十分齐全的日志库,简单易用。还有一些是对开发工程中有些小帮助的库,例如happierall/l

下面是我整理的Go语言日志库列表,大家可以依据自己项目的实际需求选择(如果您还有好用的Go日志库推荐,请留言分享)。

Project NameStarsForksDescription
logrus5471775Structured, pluggable logging for Go.
zap2761175Blazing fast, structured, leveled logging in Go.
oklog191461A distributed and coördination-free log management system
glog1496307Leveled execution logs for Go
Seelog960173Seelog is a native Go logging library that provides flexible asynchronous dispatching, filtering, and formatting.
log1562579Structured, composable logging for Go
zerolog44418Zero Allocation JSON Logger
apex/log43338Structured logging package for Go.
log21514Simple, configurable and scalable Structured Logging for Go.
blog4go18931BLog4go is an efficient logging library written in the Go programming language, providing logging hook, log rotate, filtering and formatting log message.
logutils17618Utilities for slightly better logging in Go (Golang).
log4go161109Logging package similar to log4j for the Go programming language
fileLogger8027fileLogger是一个基于Go开发的可自动分割文件进行备份的异步日志库
gogap/logrus75775Obsolete, Please refer to gogap/logrus_mate
ozzo-log7417A Go (golang) package providing high-performance asynchronous logging, message filtering by severity and category, and multiple message targets.
azer/logger749Minimalistic logging library for Go.
alexcesaro/log424Logging packages for Go
happierall/l333Golang Pretty Logger.Custom go logger for pretty print, log, debug, warn, error with colours and levels.
mkideal/log332pluginable, fast,structrued and leveled logging package
slf331Structured Logging Facade (SLF) for Go
logex296An golang log lib, supports tracking and level, wrap by standard log lib
gologger265Simple Logger for golang. Logs Into console, file or ElasticSearch. Simple, easy to use.
go-log249A logger, for Go
slog221The reference SLF (structured logging facade) implementation for Go
cxr29/log1814log - Go level and rotate log
ulog152ulog - Structured and context based logging for golang
siddontang/go-log145a golang log lib supports level and multi handlers
ccpaging/log4go13109Logging package similar to log4j for the Go programming language
mlog119A simple logging module for go, with a rotating file feature and console logging.
alog62Golang async log package
golog51golog is a multilayer & leveled & structured logger for golang.
szxp/log50A small structured logging library for Golang
go-async-log42Golang异步日志库,支持异步批量写入,按天或者小时自动切割,错误等级,多文件等
log11一个基于Golang的日志模块

最后是两个benchmark库,提供的部分Go日志库的性能对比数据,供大家做技术选型时参考

转载于:https://my.oschina.net/u/168737/blog/1536117

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值