Forever log and logrotate

后端 未结 2 1009
滥情空心
滥情空心 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:59

    i think it's because of living stream between forever and the log file.

    forever use file stream to log file. and you renamed this file by logrotate. but stream don't change. so log messages were written in api_output.log-20140418.

    if you want to change stream, you should rotate by node.js code, or use pipeline.

提交回复
热议问题