I just put together a class that listens for unhandled exceptions, and when it sees it:
- prints a stack trace to the console.
- writes its own log file to it
- sends you a stack trace
- reboots the server (or kills it, it is up to you)
This will require a little tweaking for your application, as I haven't made it general yet, but these are just a few lines, and this may be what you are looking for!
It starts from your application, you do not need to include any other files (except nodemailer.js, if you want to receive notifications by mail ..)
Check this!
Dean ather
source share