What is the default location of PM2 log files?

喜你入骨 提交于 2020-06-13 19:08:32

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!