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 2021/08/11 11:22:19 UTC

[GitHub] [apisix] dmsolr commented on a change in pull request #4795: feat(log-rotate): log file compression feature

dmsolr commented on a change in pull request #4795:
URL: https://github.com/apache/apisix/pull/4795#discussion_r686736717



##########
File path: apisix/plugins/log-rotate.lua
##########
@@ -117,6 +121,22 @@ local function rotate_file(date_str, file_type)
     local ok, msg = os.rename(file_path_org, file_path)
     core.log.info("move file from ", file_path_org, " to ", file_path,
                   " res:", ok, " msg:", msg)
+
+    if ok and enable_compression then
+        local compression_filename = new_filename .. COMPRESSION_FILE_SUFFIX
+        local cmd = string.format("cd %s && tar -zcf %s %s",

Review comment:
       Can we test whether "tar" is installed? If not installed, give a tip and then set `enable_compression = false`. (Just a question, if it is wrong, pls ignore this.)




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