You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/12/08 04:19:35 UTC

[GitHub] [apisix] 840963657 opened a new issue, #8480: bug: There is a problem with the rotation date of log-rotate plugin

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

   ### Current Behavior
   
   I set the value of  interval to 86400 (24*60*60), then access and error log files are rotate at 08:00, not 00:00
   
   
   ### Expected Behavior
   
   access and error log files should rotate at 00:00
   
   ### Error Logs
   
   ![Uploading image.png…]()
   -rw-r--r-- 1 nobody root       0 12月  4 08:00 2022-12-05_08-00-00_access.log
   -rw-r--r-- 1 nobody root  975330 12月  5 08:00 2022-12-05_08-00-00_error.log
   -rw-r--r-- 1 nobody root   82055 12月  5 17:14 2022-12-06_08-00-00_access.log
   -rw-r--r-- 1 nobody root 1719284 12月  6 08:00 2022-12-06_08-00-00_error.log
   -rw-r--r-- 1 nobody root       0 12月  6 08:00 2022-12-07_08-00-00_access.log
   -rw-r--r-- 1 nobody root 1079346 12月  7 08:00 2022-12-07_08-00-00_error.log
   -rw-r--r-- 1 nobody root       0 12月  7 08:00 2022-12-08_08-00-00_access.log
   -rw-r--r-- 1 nobody root  459141 12月  8 08:00 2022-12-08_08-00-00_error.log
   
   ### Steps to Reproduce
   
   1.open log-retate plugin;
   2.configure the following parameters on the config-default.yaml
   plugin_attr:
     log-rotate:
       interval: 86400    # rotate interval (unit: second)
       max_kept: 180     # max number of log files will be kept
       enable_compression: false    # enable log file compression(gzip) or not, default false
   3. reload apisix
   4. Observation access and error log files name
   
   ### Environment
   
   - APISIX version (run `apisix version`): 2.13
   - Operating system (run `uname -a`): Linux localhost.localdomain 3.10.0-1062.18.1.el7.x86_64 #1 SMP Tue Mar 17 23:49:17 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`): nginx version: openresty/1.19.9.1
   - etcd version, if relevant (run `curl http://127.0.0.1:9090/v1/server_info`):
   - APISIX Dashboard version, if relevant: 2.10
   - Plugin runner version, for issues related to plugin runners:
   - LuaRocks version, for installation issues (run `luarocks --version`): /usr/local/bin/luarocks 3.8.0
   


-- 
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: notifications-unsubscribe@apisix.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] 840963657 commented on issue #8480: bug: There is a problem with the rotation date of log-rotate plugin

Posted by GitBox <gi...@apache.org>.
840963657 commented on issue #8480:
URL: https://github.com/apache/apisix/issues/8480#issuecomment-1352418726

   > Reviewing the code I found that the current log-rotate only supports specifying the time interval, not the offset according to the time zone, for example, when the time zone is GMT+8 (and the interval is one day), we can specify the offset to zero.
   > 
   > Let's see if more people want this feature.
   
   OK


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: There is a problem with the rotation date of log-rotate plugin [apisix]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #8480:
URL: https://github.com/apache/apisix/issues/8480#issuecomment-1833449178

   This issue has been marked as stale due to 350 days of inactivity. It will be closed in 2 weeks if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the dev@apisix.apache.org list. Thank you for your contributions.


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] 840963657 commented on issue #8480: bug: There is a problem with the rotation date of log-rotate plugin

Posted by GitBox <gi...@apache.org>.
840963657 commented on issue #8480:
URL: https://github.com/apache/apisix/issues/8480#issuecomment-1350759371

   > 
   
   I'm sorry,The interval is 86400 (24*60*60)


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] 840963657 commented on issue #8480: bug: There is a problem with the rotation date of log-rotate plugin

Posted by GitBox <gi...@apache.org>.
840963657 commented on issue #8480:
URL: https://github.com/apache/apisix/issues/8480#issuecomment-1341986397

    log rotate time is always 12:00 pm GMT, It is independent of the time zone of apisix


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] tzssangglass commented on issue #8480: bug: There is a problem with the rotation date of log-rotate plugin

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #8480:
URL: https://github.com/apache/apisix/issues/8480#issuecomment-1347736650

   This is related to the server time zone.
   
   On APISIX v2.13, the `rotate_time` de is calculated as follows
   
   ```lua
   rotate_time = now_time + interval - (now_time % interval)
   ```
   
   if `now_time` is `1670904900`
   
   ```
   rotate_time = 1670904900 +  246060 - (1670904900 % 246060)
   ```
   
   `rotate_time` is `1670993460`,  when this time is reached, will use the  
   
   ```
   local now_date = os_date("%Y-%m-%d_%H-%M-%S", now_time)
   ```
   
   `os_date` will use the current time zone of server, try 
   
   ```
   resty -e "local now_date = os.date(\"%Y-%m-%d_%H-%M-%S\", ngx.time());print(now_date)"
   ```
   
   anc check time zone
   
   ```
   date -R
   Tue, 13 Dec 2022 12:34:03 +0800
   ```


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: There is a problem with the rotation date of log-rotate plugin [apisix]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #8480: bug: There is a problem with the rotation date of log-rotate plugin
URL: https://github.com/apache/apisix/issues/8480


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] tzssangglass commented on issue #8480: bug: There is a problem with the rotation date of log-rotate plugin

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #8480:
URL: https://github.com/apache/apisix/issues/8480#issuecomment-1351308482

   Reviewing the code I found that the current log-rotate only supports specifying the time interval, not the offset according to the time zone, for example, when the time zone is GMT+8 (and the interval is one day), we can specify the offset to zero.
   
   Let's see if more people want this feature.


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] bug: There is a problem with the rotation date of log-rotate plugin [apisix]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #8480:
URL: https://github.com/apache/apisix/issues/8480#issuecomment-1857600517

   This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time.


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org