I have a script written in node.js, it uses the "net" library and communicates with the remote service via tcp. This script is launched using the node script.js -> log.txt 'command, and everything in this script, which is registered using the console.log () function, is written to log.txt, but sometimes the script dies, and I cannot find the reason , and nothing is logged in log.txt during the script.
How can I capture the cause of the failure?
source share