简体   繁体   English

使用Forever运行我的Node应用程序不会记录任何输出

[英]Running my Node app with Forever does not log any output

I am running my node project using Forever on a Amazon CentOS EC2 instance using the following command: 我使用以下命令在Amazon CentOS EC2实例上使用Forever运行我的节点项目:

forever start -o /home/ec2-user/logs/www.log -e /home/ec2-user/logs/www.err app.js

My application runs properly but there are no www.log or www.err files created in the logs directory. 我的应用程序运行正常,但在logs目录中没有创建www.log或www.err文件。 I tried manually creating these files and setting chmod 777, and still, there is no data logged to these files. 我尝试手动创建这些文件并设置chmod 777,但仍然没有数据记录到这些文件。 I am certain that there should be data logging; 我确信应该有数据记录; I am running the same project in a similar environment and everything is logging OK. 我在类似的环境中运行相同的项目,一切都正常。 Any help is appreciated! 任何帮助表示赞赏!

I think there was a breaking change in one of the more recent node releases. 我认为其中一个最新的节点版本发生了重大变化。 Someone recently filed a related issue on GitHub: https://github.com/nodejitsu/forever/issues/193 有人最近在GitHub上提交了相关问题: https//github.com/nodejitsu/forever/issues/193

Unfortunately Forever seems to output child process error messages to stdout, so redirecting stderr to a file doesn't work. 不幸的是,Forever似乎将子进程错误消息输出到stdout,因此将stderr重定向到文件不起作用。 A temporary workaround would be to use an older version of node. 临时解决方法是使用旧版本的节点。 Hopefully a fix will be out soon. 希望很快就能解决问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM