Skip to content

fix(log-rotate): remove redundant slash in rotated log file path - #13960

Open
binafor wants to merge 1 commit into
apache:masterfrom
binafor:patch-1
Open

binafor wants to merge 1 commit into
apache:masterfrom
binafor:patch-1

Conversation

@binafor

@binafor binafor commented Sep 17, 2026

Copy link
Copy Markdown

Description

In log-rotate.lua, get_log_path_info returns filepath with a trailing slash (/).
However, init_default_logs concatenates filepath .. "/%s__" .. filename, causing redundant double slashes (e.g. /usr/local/apisix/logs//2026-09-17_00-00-00__access.log) in the rotated log target path.

This PR removes the redundant slash so the rotated file path stays normalized.

Which issue(s) this PR fixes:

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible

Remove the extra leading slash in the rotated log filename template because filepath already ends with a slash.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant