kizy008 opened a new issue, #7899:
URL: https://github.com/apache/apisix/issues/7899

   ### Description
   
   In 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.
   But I found that every new log file contains the history log message. For 
example, [log-2022-09-01_01-00-00.log] contains all message in 
[log-2022-09-01_00-00-00.log]]. So every log contains all history message.  I 
think the new log should contains message in its hour period. But I got all 
history message. 
   I want to know how to get incremental logs in new log file.
   
   我的项目中需要将日志按照小时分割并自动淘汰7天前的历史日志。 
所以我仿照[log-rotate.lua]写了file-logger的滚动切割日志插件,并且按照预期生效了。但是我发现,所有的心日志文件都包含了全量的历史日志。比如
 [log-2022-09-01_01-00-00.log]日志不仅包含了23点到0点的日志, 
还包含了所有的历史全量日志。我本以为新日志应该只包含过去1个小时之内的日志。
   我想知道如何利用file-logger在每个日志文件中保存这个小时时间段内增量的日志呢?
   
   ### Environment
   
   - APISIX version (run `apisix version`):
   - Operating system (run `uname -a`):
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
   - etcd version, if relevant (run `curl 
http://127.0.0.1:9090/v1/server_info`):
   - APISIX Dashboard version, if relevant:
   - Plugin runner version, for issues related to plugin runners:
   - LuaRocks version, for installation issues (run `luarocks --version`):
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to