Check the folder #HOME/.pm2/logs
See for example the folder structure section here: http://pm2.keymetrics.io/docs/usage/quick-start/
Also consider using a configuration file with an explicit logs folder that is relative to your scripts. (Note this folder must exist before pm2 can use it.) See http://pm2.keymetrics.io/docs/usage/application-declaration/
{
"apps": [
{
"script": "app/server.js",
"log_date_format": "YYYY-MM-DD HH:mm Z",
"error_file": "logs/server.web.error.log",
"out_file": "logs/server.web.out.log",
...
Nice way to follow these log files is to run tail
tail -f logs/*.log
UPDATE:
To be clear, using a configuration file works for python scripts. Just create a json configuration file that specifies your script and where you want the output to go. For example
{
"apps": [
{
"name": "Test Python",
"script": "test.py",
"out_file": "test.out.log",
}
]
}
Then run it
pm2 start test.json
Look for the process id in the results. Use this process ID to stop your process and to see where the log file is. E.g. pm2 show 3
interpreter_args
working as apm2
command line option. So I made a bash script that callspython -u myscript.py
andpm2 start
ed that bash script. – Ocreate