I have an express app that I start in terminal with following command to enable debug logs in it:
DEBUG=custom:* npm start (on Ubuntu)
SET DEBUG=custom:* & npm start (on Windows)
On production server, I start app with PM2 using following command:
pm2 start bin/www -i 0
But this does not enable the debug
logs in my code, so the debug statements are not added to the logs, only console.error()
are added to the log files. How can I pass the DEBUG=custom:*
option while starting my app with PM2?
debug
logs are going towww-error-0.log
file not thewww-out-0.log
file. I was expecting these debug logs to go to output log file not error log file. Is that expected? – Nerti