@eeeee if you’re using the console, you could try
node app.js > app.log 2>&1
This would redirect stdout to a file named app.log and redirect stderr to stdout.
I’m not sure about standard logging under NodeBB, but there is an error log located at logs/error.log.
Failing that, you could always stop the NodeBB service then use ./nodebb dev from the console which would then provide debug output.