Debugging things on production is a little more difficult but not impossible.
You can activate debug on the fly on a production server and attach a remote debugger to it.
First isolate one of your problematic servers to ensure no more traffic is directed to it. On AWS, you could remove it from the load balancer for example. It's important to do that to ensure you are not affecting users while debugging production...
ssh to this server and send a SIGUSR1 signal to your node process. It will activate debug without restarting the process. (nodejs.org/api/process.html)
If the debug port of node (5858) is not opened on the production server, you can forward it using ssh. If I remember well, you do that with -L option
Open your favorite node remote debugger along with your code.
You can now put breakpoints on your production server :)
Sébastien De Saint Florent
Hi,
Debugging things on production is a little more difficult but not impossible. You can activate debug on the fly on a production server and attach a remote debugger to it.
First isolate one of your problematic servers to ensure no more traffic is directed to it. On AWS, you could remove it from the load balancer for example. It's important to do that to ensure you are not affecting users while debugging production...
ssh to this server and send a SIGUSR1 signal to your node process. It will activate debug without restarting the process. (nodejs.org/api/process.html)
If the debug port of node (5858) is not opened on the production server, you can forward it using ssh. If I remember well, you do that with -L option
Open your favorite node remote debugger along with your code.
You can now put breakpoints on your production server :)
Bye,