title: Get node console output to file with pm2
body: <p>How can I get node console output (such as errors) to a file with pm2? 
  I tried to run <code>pm2 task --log-type json</code> but it didn't work</p>
  
  <p>There is no log file in /var/log or in the project directory.</p>
  
  <p>How can I achieve this?</p>