0

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.

1pratham
  • 1
  • 1

2 Answers2

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!

Sander
  • 11
  • 1
0

It may require some code changes to lsws/fcgi-bin/lsnode.js to setup a log file for stdout. Currently there is some code to open a file based on LSNODE_CONSOLE_LOG, but it was not assigned to stdout, it may not work.

Kacey
  • 1
  • 1
    It would be helpful if you could expand your answer to provide the exact changes that would be required. – womble Oct 04 '19 at 02:47