Pm2: Using debug module with pm2 logs

Created on 8 Nov 2015  路  4Comments  路  Source: Unitech/pm2

I have been trying to get the debug module to work within the logs on production. I am seeing problems and need to dig deep to why.

What am I doing wrong?

PM2_DEBUG=true pm2 start --node-args="DEBUG='*'" --env="DEBUG='*'" start.js

Most helpful comment

@tkalfigo You need to add --update-env option to tell PM2 to pickup new environment and inject it into the new process

All 4 comments

Hello,

DEBUG='*' pm2 start start.js
DEBUG='*' pm2 restart start.js

I'm sorry to say I'm still having this problem.

I start the app with

DEBUG='*' pm2 restart 1

The app with id 1 restarts but I only see the DEBUG messages of pm2 and not from my app.

I'm at latest pm2 v2.6.1

@tkalfigo You need to add --update-env option to tell PM2 to pickup new environment and inject it into the new process

@vmarchaud Worked like a charm! You saved the day. Thanks! :)

Was this page helpful?
0 / 5 - 0 ratings