1. 首页
  2. 数据库
  3. 其它
  4. Go日志滚动模块logrotator的使用方法及性能

Go日志滚动模块logrotator的使用方法及性能

上传者: 2021-01-10 10:54:28上传 PDF文件 47.38KB 热度 9次
logrotator是一款非常小巧的Go语言日志滚动输出模块,而日志写入速度较go-file-rotatelogs显著提升。模块本身只实现日志滚动输出和旧日志删除两个功能;由于模块实现了io.Writer接口,所以可以结合其它日志框架如logrus来实现更复杂的功能。 获取: go get “github.com/pochard/logrotator@v1.1.2” 引用:import “github.com/pochard/logrotator” 示例1:按指定时间间隔滚动 NewTimeBasedRotator(pattern string, period time.Duration) 函
下载地址
用户评论