saintak commented on issue #5658:
URL: https://github.com/apache/apisix/issues/5658#issuecomment-984366399


   > @lihuawei321 @saintak @jiangkaiyuan98 Thanks feedback. Reopen and 
compression will cause log record exceptions. We will fix this problem in the 
latest version.
   
   能否加个feature,把tar czvf 改成gzip,后者更方便后续分析。在只有一个文件需要处理的时候打成一个tar包问题多多:
   less tar.gz 我们会看到如下内容:
   
   -rw-r--r-- nobody/root     203 2021-12-02 15:35 
2021-12-02_15-34-00__error.log
   2021-12-02_15-34-00__error.log.tar.gz (END)
   zcat tar.gz 是这样的:
   zcat 2021-12-02_15-34-00__error.log.tar.gz
   
2021-12-02_15-34-00__error.log0000644000014300000000000000031314152073437014142 
0ustar  nobodyroot2021/12/02 15:34:55 [warn] 4012#4012: *2507624 [lua] 
log-rotate.lua:138: rotate_file(): remove uncompressed log file: 
/usr/local/apisix/logs/2021-12-02_15-34-00__access.log ret: true, context: 
ngx.timer
   这样对后续统计分析和查看都是很不利的,相反使用gzip之后:
   less 2021-12-02_15-34-00__error.log.gz可以直接显示log内容(而不是文件信息)
   zcat 2021-12-02_15-34-00__error.log.gz
   2021/12/02 15:36:00 [warn] 4012#4012: *2510131 [lua] log-rotate.lua:138: 
rotate_file(): remove uncompressed log file: 
/usr/local/apisix/logs/2021-12-02_15-34-00__access.log ret: true, context: 
ngx.timer
   而且gzip无论是压缩还是解压会默认删除源文件。无需你们再清理原来的文件了。很方便
   


-- 
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-unsubscr...@apisix.apache.org

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


Reply via email to