-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Finding out why an app crashed #190
Comments
Are you sure you want to use forever, which is basically on life support, in non-legacy system? pm2 and nodemon are better choices these days. That said, if you are quite sure, I can take a look. |
@scripting I'd agree with the prior comment about Forever being 'on life support', I still have it in production on a few projects, but have been using PM2 as my production process manager for Node.js. I believe it can provide what you're seeking here. But instead of relying on it solely, I still do my own error handling and std out to console (which pipes to PM2 logging) for trouble shooting. (Love the blog -- keep up the great work!) |
Thanks @kibertoad and @tamaker -- not sure what the pragmatic cost of being "on life support" is -- but I have it working, and I don't want to redo all this. Anyway I want to get this working properly and then get back to my other projects, so if you can help me figure out how to hook up to the system's error reporting mechanism that would be great. I have a feeling it doesn't have that much to do with Forever, it's just figuring out what to ask the OS for. I assume they're not ripping up the OS too. ;-) |
@scripting - my reference to 'life support' has more to do with just the shallow set of features and low-energy development trajectory (or my perception of these things anyway). Forever is rock solid, I think you're at a fork in the road where your needs are moving beyond it's limitations -- at least that's where I was a few years ago on a big project. To test this out with your existing code, it's shockingly straight forward with PM2 (I really like that it doesn't have tentacles deeply embedded in my codebase! I don't recall ever having to change my code to accommodate it actually.) TO TEST YOUR APP WITH PM2 PROCESS MANAGER: Once running, here's some commands you'd find useful:
In my experience it has proved useful to:
I think you could test this out in 5 minutes, if that -- just install PM2 and run your app from PM2, doesn't work out for you, no harm no foul and just uninstall it with npm via command line. Keep us posted, good luck! (Apologies for grammar and structure, I keep picturing you marking up my post with red ink!) |
@tamaker -- maybe my initial post wasn't clear. I'm not using Forever in an interactive mode. I'm using it as an API within my web server app. You're giving me instructions for using it interactively. I appreciate all the energy you put into this, and you seem to really enjoy PM2, but this is one of those times when a little reading would have saved you a lot of writing. ;-) |
Note that PM2 has programmatic usage mode as well. |
@scripting no worries, @kibertoad is correct, I'm starting to dabble with PM2 in a programmatic sense as well, and have my own express-based API to accept commands -- note: THAT route does indeed involve writing code to integrate it. But in my use case, it's worth the time to give me a full-featured, interface to 'manage' / 'control' my app. At any rate, what you're describing would indeed be a neat extension to forever! Good luck! |
I still would like to figure this out. Thanks for respecting that and let's move on please. |
Part of the implications of what was mentioned before is that there are no active duty maintainers with decent knowledge how forever works. I'll take a look when I have some time, but results are not guaranteed :). PRs to improve current situation are definitely welcome, though. |
Have you considered using an Exception handling service like Sentry? You can self-host the backend fairly painlessly so it's not like you're introducing a black hole of cost. |
I am adding Forever functionality to my web server, PagePark.
Basically where ever you can put web content, you can put a Node app.
We assign a port and route requests to the domain name you've declared. It works nicely, and I'm already using it in deployed apps.
My question -- how do you get a handle on the error when one of the apps crashes, ie when Forever relaunches it after an error.
I'll provide the code below that I use that I think should catch the error, but it clearly doesn't in at least some circumstances.
I got the error to show up by running the app standalone, and then the OS gave me the error and stack crawl, and I was on my way. I want the same info when Forever is managing the app.
Thanks in advance for any help.
The text was updated successfully, but these errors were encountered: