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

   ### Current Behavior
   
   When log-rotate plugin is enabled, the latest logs are not pushed onto the 
latest created log file. Instead they are buffered somewhere and pushed in the 
new file that is created after a certain interval. For example, when the 
interval is 60 seconds, I do not get any access logs for 60 seconds between 
00:05:00 to 00:06:00. Then a new access log file is created with the name 
`2023-05-10_00-06-00__access.log`  and contains the logs of the last 60 seconds 
as pasted below
   ```
   127.0.0.1 - - [10/May/2023:00:05:03 +0530] mockbin.org "GET /request 
HTTP/1.1" 200 1003 0.943 "-" "curl/8.0.1" 172.64.203.7:80 200 0.934 
"http://mockbin.org";
   127.0.0.1 - - [10/May/2023:00:05:07 +0530] mockbin.org "GET /request 
HTTP/1.1" 200 1003 0.683 "-" "curl/8.0.1" 172.64.203.7:80 200 0.683 
"http://mockbin.org";
   127.0.0.1 - - [10/May/2023:00:05:12 +0530] mockbin.org "GET /request 
HTTP/1.1" 200 1002 0.930 "-" "curl/8.0.1" 172.64.202.7:80 200 0.916 
"http://mockbin.org";
   127.0.0.1 - - [10/May/2023:00:05:19 +0530] mockbin.org "GET /request 
HTTP/1.1" 200 1005 0.874 "-" "curl/8.0.1" 172.64.202.7:80 200 0.866 
"http://mockbin.org";
   127.0.0.1 - - [10/May/2023:00:05:30 +0530] mockbin.org "GET /request 
HTTP/1.1" 200 1004 0.953 "-" "curl/8.0.1" 172.64.203.7:80 200 0.937 
"http://mockbin.org";
   127.0.0.1 - - [10/May/2023:00:05:39 +0530] mockbin.org "GET /request 
HTTP/1.1" 200 1004 0.746 "-" "curl/8.0.1" 172.64.203.7:80 200 0.746 
"http://mockbin.org";
   ```
   
   ### Expected Behavior
   
   Is this already the expected behaviour that the latest log file generated at 
timestamp X will only contain logs until X-interval? If not, then the behaviour 
should be that the logs are pushed onto the latest access log file. 
   
   ### Error Logs
   
   _No response_
   
   ### Steps to Reproduce
   
   Follow the guide here to enable log-rotate and set the interval to 60 
seconds. 
   https://apisix.apache.org/docs/apisix/plugins/log-rotate/
   
   ### Environment
   
   - APISIX version 3.3.0
   - Operating system Linux 6.2.13-arch1-1
   - nginx version: openresty/1.21.4.1
   
   


-- 
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