简体   繁体   English

如何查看node / express的console.log / stdout或console.error / stderr输出?

[英]How can I view console.log/stdout or console.error/stderr output from node/express?

When running express locally, I can see console.log/console.error output in the console. 在本地运行express时,我可以在控制台中看到console.log / console.error输出。 When running on a server, where is this information logged? 在服务器上运行时,此信息记录在哪里?

How is express running on your server? Express如何在您的服务器上运行?

If, for example, you are running it via pm2, pm2 will capture stdout and stderr and log it to a file(s). 例如,如果您通过pm2运行它,则pm2将捕获stdout和stderr并将其记录到文件中。 The details of where this will be logged are specific to the host process. 将在何处记录此详细信息特定于主机进程。

In the pm2 case, the logs default to ~/.pm2/logs 在pm2情况下,日志默认为〜/ .pm2 / logs

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

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