Appearance
Logs
Use PM2 logs command for both production and development if PM2 was used to start or restart the Nodejs instances for each app.
When using the scripts from each app to start or restart, the scrip gives the instance a process name. These names are used to gather their logs.
sh
pnpm start-prod-pm2
# uses
# NODE_ENV=production pm2 start src/index.js --name telegram --time
pnpm start-dev-pm2
# uses
# NODE_ENV=development pm2 start src/index.js --name telegram-dev --timeThe possible process names are as follows.
- telegram
- telegram-dev
- discord
- discord-dev
Log file names
The output and error logs for each process name (apps) are in separate files.
Production:
- telegram-out.log
- telegram-error.log
- discord-out.log
- discord-error.log
Development:
- telegram-dev-out.log
- telegram-dev-error.log
- discord-dev-out.log
- discord-dev-error.log
Commands
Get the combined production logs from both the telegram-out.log and telegram-error.log files and start with the last 100 lines.
sh
pm2 logs --lines 100 telegramGet the combined development logs from both the telegram-dev-out.log and telegram-dev-error.log files and start with the last 100 lines.
sh
pm2 logs --lines 100 telegram-devTo access Discord files simply change the process name to use discord or discord-dev.

