help request: [file-logger] duplicate log, new log file contains history log message #7902
-
DescriptionIn my project, I need split log file by hour and delete logs 7 days ago. So I write a rotate plugin like [log-rotate.lua], and it works. 我的项目中需要将日志按照小时分割并自动淘汰7天前的历史日志。 所以我仿照[log-rotate.lua]写了file-logger的滚动切割日志插件,并且按照预期生效了。但是我发现,所有的心日志文件都包含了全量的历史日志。比如 [log-2022-09-01_01-00-00.log]日志不仅包含了23点到0点的日志, 还包含了所有的历史全量日志。我本以为新日志应该只包含过去1个小时之内的日志。 Environment
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 9 replies
-
i meet same problem。can u show u code? |
Beta Was this translation helpful? Give feedback.
-
Do you follow the two steps ? |
Beta Was this translation helpful? Give feedback.
-
how to notify other processes |
Beta Was this translation helpful? Give feedback.
-
You could use ngx.shared.dict to notify other processes.
|
Beta Was this translation helpful? Give feedback.
-
Since this is your own code, not related to the project, I turned it into discussion. |
Beta Was this translation helpful? Give feedback.
You could use ngx.shared.dict to notify other processes.
For example