Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: log-rotate not work when access log is file and error log /dev/stderr #11915

Open
darkSheep404 opened this issue Jan 15, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@darkSheep404
Copy link
Contributor

Current Behavior

when access log is a file and error log is /dev/stderr
log-rotate will not work
cause it will attempts to rename and move error log which is /dev/stderr and get a error :

log-rotate.lua:150: rename_file(): move file from /dev/stderr to /dev//2025-01-13_08-50-00__stderr
 res:nil msg:/dev/stderr: Permission denied, context: ngx.timer

and successfully rename and move access.log to 2025-01-13_08-50-00__access.log
Then it will return and do not exec signal.kill(pid, signal.signum("USR1")), access log keep writing to 2025-01-13_08-50-00__access.log and no new access.log be created.
so, when next time do log rotate
will get an error like below

move file from /usr/local/apisix/logs/access.log to /usr/local/apisix/logs//2025-01-13_08-37-00__access.log res:nil msg:/usr/local/apisix/logs/access.log: No such file or directory, context: ngx.timer

Expected Behavior

log rotate should work normally when error_log or access log are set to /dev/stderr.

Error Logs

No response

Steps to Reproduce

set error_log to /dev/stderr

nginx_config:
  error_log: /dev/stderr

Environment

  • APISIX version (3.9.0)
@dosubot dosubot bot added the bug Something isn't working label Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant