Project Logs via PM2 on a VPS Server

Scripts launched via PM2 do not output console.log to the server console. Also, such scripts do not output occurred errors. However, PM2 allows you to configure the output of all this to files.

This is how we will make the results of console.log execution output to a file:

/var/www/test.compm2 start app.js -o output.txt --time

And this is how we will make occurred errors output to a file:

/var/www/test.compm2 start app.js -e error.txt --time

And this is how we will output both:

/var/www/test.compm2 start app.js -o output.txt -e error.txt --time
Задание 1

Launch your test script with output of messages and errors to files.