使pm2记录到控制台 [英] Make pm2 log to console
问题描述
我正在使用pm2运行节点Web服务器.由于pm2产生了另一个进程并将stdout和stderr重定向到文件,因此我必须在其他地方查找日志.理想情况下,我希望将节点进程输出到运行pm2的同一控制台窗口.否则,我将为pm2做好准备,使用活动的控制台窗口运行节点进程,并将节点进程的stdout和stderr写入该控制台窗口.如何做到这一点?我在Windows机器上.
I am running a node webserver using pm2. Since pm2 spawns another process and redirects stdout and stderr to files, I have to look somewhere else for the logs. Ideally, I would like to have the node process output to the same console window that I've run pm2 from. Otherwise, I would settle for pm2 run the node process with an active console window and have stdout and stderr of the node process write to that console window. How can this be achieved? I'm on a windows machine.
推荐答案
我相信您也可以看到正在运行的由进程守护进程守护进程的 stdout 和 stderr .命令pm2 logs
或pm2 logs [app-name]
.
I believe you can also see the stdout and stderr of a process that is running daemonized by the command pm2 logs
or pm2 logs [app-name]
.
这篇关于使pm2记录到控制台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!