Node.js OpsWorks Layer console logs

前端 未结 4 1217
暖寄归人
暖寄归人 2020-12-30 14:35

I have an Opsworks stack with a Node.js Layer and Node.js Application. I\'m wondering if anyone knows where on an ubuntu 14.04LTS instance the console logs from my applicati

4条回答
  •  抹茶落季
    2020-12-30 15:11

    Unless behavior of console.log was altered, node will output console.log logs to the application's standard output (stdout). If you are running your node application in a console or using ssh, you should see the logs there. Otherwise, try redirecting the stdout of your application to a file so you can see it even if you run it without a console, in this way: node myapp.js > logfile

    A preferred way would be to user Forever to make sure you application is constantly on and there you can redirect your output (both stdout and stderr) as follows:

    />forever -o forever.out -e forever.err myapp.js
    

提交回复
热议问题