darkSheep404 opened a new issue, #11915:
URL: https://github.com/apache/apisix/issues/11915

   ### 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 : 
   ```lua
   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 
   ```lua
   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` 
   ```yml
   nginx_config:
     error_log: /dev/stderr
   ```
   
   ### Environment
   
   - APISIX version (3.9.0)
   


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

Reply via email to