-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
os/glog/glog_logger_rotate.go:The time for slicing should be based on the file creation time rather than the update time #3620
Comments
… edit time to create time (gogf#3620)
(3620)[gogf/gf#3620] 先临时使用自己修复的(gf)[https://gitee.com/yijunqiang/gf.git]替代一下
…me change edit time to create time, no good solution, only darwin system effective. (gogf#3620)
只能通过给日志文件名添加{Y-m-d}日期配置来让按时间切片生效,因为linux系统文件没有创建时间。 |
Time slicing can only take effect by adding {Y-m-d} date configuration to the log file name, because Linux system files do not have a creation time. |
无需处理 |
No processing required |
Go version
go1.22.3 darwin/amd64
GoFrame version
v2.7.1
Can this bug be reproduced with the latest release?
Option Yes
What did you do?
日志配置了按时间切片。配置如下:
What did you see happen?
比如昨天12点启动程序,生成了日志文件
log/access.log
,持续到今天13点时,也没有生成log/access.log
的切片。What did you expect to see?
应该按文件的创建时间来判断是否生成切片,而不是修改时间。
框架的相关逻辑如下:
github.com/gogf/gf/v2@v2.7.1/os/glog/glog_logger_rotate.go:163
其中获取文件时间这块
mtime = gfile.MTime(file)
实际取到的文件修改时间。The text was updated successfully, but these errors were encountered: