You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "abs007 (via GitHub)" <gi...@apache.org> on 2023/04/04 06:47:15 UTC

[GitHub] [apisix] abs007 commented on a diff in pull request #9210: feat: Add support for custom named log file names for log-rotate plugin

abs007 commented on code in PR #9210:
URL: https://github.com/apache/apisix/pull/9210#discussion_r1156801383


##########
apisix/plugins/log-rotate.lua:
##########
@@ -265,6 +265,22 @@ local function rotate_file(files, now_time, max_kept)
     end
 end
 
+local function get_custom_logfile_name()
+    local custom_file_name = core.config.local_conf()
+
+    local new_error_log = core.table.try_read_attr(local_conf, "nginx_config", "error_log")
+    local new_access_log = core.table.try_read_attr(local_conf, "nginx_config", "http", "access_log")
+
+    if new_access_log then
+        DEFAULT_ACCESS_LOG_FILENAME = new_access_log

Review Comment:
   So, check for custom access and log values over here and then set the value for `DEFAULT_ACCESS_LOG_FILENAME` and `DEFAULT_ERROR_LOG_FILENAME` accordingly?



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