Openlitespeed view nodejs stdout/console.log logs
I am trying to setup a nodejs server with openlitespeed as proxy server on digital ocean using the one click litespeed nodejs image from their marketplace.
Everything is working fine. I just want to know how can I access console.log logs of nodejs?
I have checked server and access logs of both server and virtual host on litespeed. But can't find console.log logs there.
I can find the stderr/console.error logs in stderr.log file of litespeed.
Solution 1:
Bit of an old thread, but changing the following worked for me:
In /usr/local/lsws/fcgi-bin/lsnode.js
(or wherever your lsws installation lives), find the function startApplication()
and then change the line:
var consoleLog = process.env.LSNODE_CONSOLE_LOG || '/dev/null';
to
var consoleLog = '/path/to/your/logFile.log' || '/dev/null';
Ensure the file exists and that the lsws user has write access. Hope this helps!