2021年3月15日

摘要: 当服务器常年运行的时候,日志文件就会非常的大,这里讲下用 gin 框架如果切割日志文件,代码如下: package main import ( "github.com/gin-gonic/gin" rotatelogs "github.com/lestrrat-go/file-rotatelogs" 阅读全文
posted @ 2021-03-15 13:37 沈恩忍 阅读(984) 评论(0) 推荐(0) 编辑
摘要: iris 官方案例只给了文件日志,但没有给日志分割的方法,一旦访问量过大,日志文件就成吨成吨的,这很让我苦恼。经研究使用 github.com/lestrrat-go/file-rotatelogs 包可解决,代码如下: package main import ( rotatelogs "githu 阅读全文
posted @ 2021-03-15 13:24 沈恩忍 阅读(743) 评论(0) 推荐(0) 编辑

导航