Revolyssup commented on code in PR #9619:
URL: https://github.com/apache/apisix/pull/9619#discussion_r1243226511
##########
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"
+ if not exists then
+ local file = io_open(filename, "w")
+ if file then
+ file:close()
+ end
+ end
Review Comment:
@monkeyDluffy6017 removed this check
--
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]