monkeyDluffy6017 commented on code in PR #9619:
URL: https://github.com/apache/apisix/pull/9619#discussion_r1236433053


##########
apisix/plugins/log-rotate.lua:
##########
@@ -143,10 +157,18 @@ local function rename_file(log, date_str)
         core.log.info("file exist: ", new_file)
         return new_file
     end
-
-    local ok, err = os_rename(log.file, new_file)
+    local filename = log.file
+    -- create the file if it does not exist
+    local exists = lfs.attributes(filename, "mode") == "file"

Review Comment:
   @Revolyssup please check 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-unsubscr...@apisix.apache.org

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

Reply via email to