Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
iredmail opened this issue Dec 8, 2023 · 2 comments
Open

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

iredmail opened this issue Dec 8, 2023 · 2 comments
Assignees

Comments

@iredmail
Copy link

iredmail commented Dec 8, 2023

System (please complete the following information):

  • OS: linux
  • GO Version: 1.21.5

Describe the bug

内建的 rotate 机制:

  • 在设置了 max backup 为 90 的情况下,只有3个备份。
  • rotate 之后,gzip 压缩的 log 文件内容不完整,有大量文本丢失。
@inhere
Copy link
Member

inhere commented Dec 8, 2023

有简单的复现方法吗?

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

@iredmail
Copy link
Author

iredmail commented Dec 8, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants