Skip to content

Instantly share code, notes, and snippets.

@yunnysunny
Created March 15, 2017 04:03
Show Gist options
  • Save yunnysunny/13757ee442a4674f761fb04ebf6d5fa3 to your computer and use it in GitHub Desktop.
Save yunnysunny/13757ee442a4674f761fb04ebf6d5fa3 to your computer and use it in GitHub Desktop.
The file which can make you node process break down
console.log(xxx);
@yunnysunny
Copy link
Author

Run the command :

pm2 start err.js --log-date-format "YYYY-MM-DD HH:mm"

The error log will show:

ReferenceError: xxx is not defined
    at Object.<anonymous> (F:\temp\sodu_build\err.js:1:75)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Function._load (d:\Users\sunny\AppData\Roaming\nvm\v6.9.2\node_modules\pm2\node_modules\.0.6.8@pmx\lib\transaction.js:62:21)
    at Object.<anonymous> (d:\Users\sunny\AppData\Roaming\nvm\v6.9.2\node_modules\pm2\lib\ProcessContainerFork.js:52:21)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)

In other words, the parameter of log-date-format does not take effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment