Useful stuffs for pm2

Commands and concepts

General commands

# list all process
pm2 ls

# restart process
pm2 restart 'id'


# empty current activity logs
pm2 flush

Search keyword in logs

pm2 logs | grep -i "KEYWORD"

logrotate

pm2 install pm2-logrotate

# NOTE: the command is pm2 install NOT npm install