Moh*_*waj 5 node.js express pm2
我有一个快速应用程序,我在终端中使用以下命令启动它以启用其中的调试日志:
DEBUG=custom:* npm start (on Ubuntu)
SET DEBUG=custom:* & npm start (on Windows)
Run Code Online (Sandbox Code Playgroud)
在生产服务器上,我使用以下命令通过 PM2 启动应用程序:
pm2 start bin/www -i 0
Run Code Online (Sandbox Code Playgroud)
但这不会debug在我的代码中启用日志,因此调试语句不会添加到日志中,仅console.error()添加到日志文件中。DEBUG=custom:*使用 PM2 启动我的应用程序时如何传递该选项?
尝试DEBUG='custom:*' pm2 start bin/www -i 0
如果要重新启动现有进程,请添加 --update-env 标志:
DEBUG='custom:*' pm2 restart bin/www -i 0 --update-env
| 归档时间: |
|
| 查看次数: |
9614 次 |
| 最近记录: |