0

I am using the "screen" tool to run a Node.js API on a server.

I can get the API running so it is active for all to see but it crashes occasionally and it always happens when the screen session is no long open and therefore I don't know why the API has crashed.

Is there a way to see the error messages related to why my API crashed when I go back to that screen session later?

I have tried ctrl+a H to get a log but that didn't work.

Haych
  • 932
  • 13
  • 36

1 Answers1

0

Did you try to start screen with the -L flag? It will start logging the contents to a log file.

If this does not capture the errors, you can try to use tee for logging them in bash as described in echo to stderr and tee to log file?

Community
  • 1
  • 1
tkja
  • 1,950
  • 5
  • 22
  • 40