Skip to content

bug: log-rotate plugin should not rotate the access log when the enable_access_log setting is set to false #11309

Description

@flearc

Current Behavior

The log-rotate plugin rotates the access log regardless of the enable_access_log setting.

Expected Behavior

The log-rotate plugin should skip rotating the access log if enable_access_log is set to false.

Error Logs

2024/05/31 09:41:48 [error] 57#57: *428 [lua] log-rotate.lua:150: rename_file(): move file from /usr/local/apisix/logs/access.log to /usr/local/apisix/logs//2024-05-31_09-41-48__access.log res:nil msg:/usr/local/apisix/logs/access.log: No such file or directory, context: ngx.timer

Steps to Reproduce

  1. Add the Configuration to config.yaml
nginx_config:
  http:
    enable_access_log: false

plugins:
  - log-rotate

plugin_attr:
  log-rotate:
    interval: 1
  1. Mount config.yaml and run APISIX via the docker image
  2. Check the error log

Environment

  • APISIX version (run apisix version): 3.9.0

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status
✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions