Forever log and logrotate

后端 未结 2 978
滥情空心
滥情空心 2021-02-05 11:06

I use forever to launch my nodeJs server and I choose the log file :

forever -l /home/api/log/api_output.log start server.js

I use logrotate to move logfile ever

2条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-05 11:54

    I forgot copytruncate option in my config file, now it's working :

    /etc/logrotate.d/api :

    /home/api/log/api_output.log {
      #size 50k
      daily
      dateext
      missingok
      rotate 7
      compress
      delaycompress
      notifempty
      #create 644 root
      copytruncate  
    }
    

提交回复
热议问题