Using PM2 for startup

I am using PM2 for starting up my mediasoup application and have set the log level for mediasoup to debug. I am still not seeing mediasoup messages in my log file.Attached is my config file for PM2


module.exports = {
apps: [{
name: ‘Mediasoup-Training-Server’,
script: ‘src/server.js’,
exec_mode: ‘fork_mode’,
log_date_format: ‘YYYY-MM-DD HH:mm:ss Z?’,
watch: ‘./src’,
autorestart: true,
shutdown_with_message: true,
kill_timeout: ‘5000’,
time: true,
log_file: ‘logger/Mediasoup-Training-Server.log’,
env: {
NODE_ENV: process.env.NODE_ENV,
DEBUG: process.env.LOGS_ENABLED,
I am wondering if any one has used Pm2 for starting up mediasoup process and gotten debug logs to go the log file specified in the PM2 config

Maybe you should pass the DEBUG variable inside the env: {} object.

And that lead me to my answer I think. I was passing the DEBUG variable in env but the variable didnt have mediasoup* in it… the moment I put that in an voila it seems to be doing the trick. Thank you for your guidance.