Forever log and logrotate

醉酒当歌 提交于 2019-12-03 03:10:30

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  
}

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!