gookit / slog

📑 Lightweight, configurable, extensible logging library written in Go. Support multi level, multi outputs and built-in multi file logger, buffers, clean, rotate-file handling.一个易于使用的,轻量级、可配置、可扩展的日志库。支持多个级别,输出到多文件;内置文件日志处理、自动切割、清理、压缩等增强功能
https://pkg.go.dev/github.com/gookit/slog
MIT License
383 stars 24 forks source link

内建的 rotate 机制有多个bug #129

Open iredmail opened 9 months ago

iredmail commented 9 months ago

System (please complete the following information):

Describe the bug

内建的 rotate 机制:

inhere commented 9 months ago

有简单的复现方法吗?

在设置了 max backup 为 90 的情况下,只有3个备份。 -- 是不是还配置了按时间清理的

iredmail commented 9 months ago

目前是在实际长期运行的程序里使用了 slog,通过观察程序的实际表现发现的这个问题。 暂时还没有时间去整理复现此问题的代码,但我猜测简单地将 rotate 间隔缩短到例如一分钟,再手动触发一些 log 操作让它记录一些内容,足以重现这个问题。