-
Notifications
You must be signed in to change notification settings - Fork 944
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to use debug with PM2? #503
Comments
Isn't it possible to use the ecosystem.config.js to configure different environment variables when starting a process with PM2? Should be possible to include |
That works, and there is another question, the debug logs are all in PM2's error log, not in out.log, do you know why? |
When you use debug on nodejs it writes to stderr by default (see node.js) It is possible though to redirect the output of a logger to another stream https://github.com/visionmedia/debug/blob/master/examples/node/stdout.js The pattern I'm usually using when working with debug is this:
then I just require my new log factory in my modules like this
Note that you have to rewrite the error.log part to something like this if ES6 spread syntax is not available in your environment
|
That's greet! |
how to use debug with PM2?
DEBUG=* pm2 start app.js
There is no debug logs.
The text was updated successfully, but these errors were encountered: