To add dates to pm2 error logs with JavaScript, we add the --lof-date-format
option.
For instance, we run
pm2 start app.js --log-date-format 'DD-MM HH:mm:ss.SSS'
to set the --log-date-format
to the date format we want for the log entry date to include the date in each log entry.