Thursday, April 28, 2022

[SOLVED] Ubuntu where to see console.logs

Issue

So I am putting my app on a server and I want to see some console logs generated from my nodejs app. Before putting it on the server I saw the output of my console log on my terminal, but where do I find the output for these on Ubuntu? I'm running version 16.04 on Ubuntu


Solution

Lifted straight from @SlovyanskiyYehor comment two years ago, but I missed his answer as a comment. Also answered here: Make pm2 log to console.

If you are using pm2 to start your node.js application, you can use:

pm2 logs

or for just a single app running in pm2:

pm2 logs yourAppNameHere


Answered By - Adam Marsh
Answer Checked By - Clifford M. (WPSolving Volunteer)