go-zero icon indicating copy to clipboard operation
go-zero copied to clipboard

logx doesn't handle the scenario that log files are deleted by accident

Open zmjaction opened this issue 2 years ago • 3 comments
trafficstars

程序正常启动,在使用logx写日志时发现,在删除生成的log日志文件后(可能存在误删),就不会再次生成新的日志文件问题。

zmjaction avatar May 24 '23 01:05 zmjaction

Yes, this scenario is reasonable. In theory, why would a service running online delete log files? This behavior itself is unreasonable.

MarkJoyMa avatar Jun 16 '23 06:06 MarkJoyMa

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Jun 22 '24 01:06 github-actions[bot]

To fix the file deleted problem, we need to create a ticker to check the file existence periodically. I think we don't need to do that. Recommend to handle the log files correctly instead of implementing it in framework.

kevwan avatar Jun 22 '24 10:06 kevwan