问题
I'm trying to find out where PM2 saves the log files by default?
I'm working with a Linux Ubuntu 16.04 server and I've installed it globally with npm i pm2 -g
.
回答1:
pm2 saves logs to $HOME/.pm2/logs/XXX-err.log
by default, where XXX
is your pm2 app name
回答2:
I wanted to see the logs for different processes. There is a console-based UI for this:
pm2 monit
Extra tips for pm2 newbies:
- Launch multiple, co-ordinated, instance per cpu core with:
pm2 start myApp.js -i max
- Beware the 'js' example of cluster configuration; it didn't work for me. Try 'json' instead.
- By default, you need to leave user logged in to keep cluster running
- Handy commands:
pm2 start all
(also stop / delete)pm2 list
来源:https://stackoverflow.com/questions/55828017/what-is-the-default-location-of-pm2-log-files