我正在使用以下命令来启动永久命令:
/usr/local/bin/forever start /var/www/html/test.js | tee /tmp/forever-start.log
但是这不起作用。不在日志文件中打印输出。
在 test.js
中,
我有这样的代码: console.log('服务器正在运行...');
最佳答案
永远不会输出您使用 console.log
打印的内容。
您应该使用forever的-o OUTFILE
选项来指定日志文件。就像这样:
forever start -o /tmp/forever-start.log /var/www/html/test.js
关于javascript - 永远启动命令不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36033806/