I have a gulpfile with a pm2 task that runs in foreground mode (--no-daemon):
gulp.task('serve', function() {
pm2.connect(true, function() {
pm2.start({
name: 'api',
script: 'api.js'
}, function() {
console.log('pm2 started');
});
});
});
The application api.js started by pm2 logs output to the console, but this does not make it out to the console from which I launch gulp. This happens in both fork and cluster mode.
I can see api.js output using the pm2 logs command, but I need the output to show up in the gulp console as well. Additionally, pm2 start api.js --no-daemon correctly logs to the console. How can this be done via gulp and/or the pm2 api?
:+1:
gulp.task('serve', function() {
pm2.connect(true, function() {
pm2.start({
name: 'api',
script: 'api.js'
}, function() {
console.log('pm2 started');
pm2.streamLogs('all', 0);
});
});
});
Feel free to re-open if needed ;)
Hi all,
I've gulp task with pm2 and I want to add the debug args, my script is:
pm2.start({
script: buildConfig.serverDir + "/ServerApp.js",
"node-args": ["--debug=5858"]
}, function () {
logger.info('Server started');
});
The server started but the args debug looks like does not work?
Could you help me,
Thanks,
Dustin
Most helpful comment