10 Tips for Debugging in Production

Heisenbugs
Courtesy: Geek and Poke

This is an interesting story of how this team solved a tricky bug. What followed was a checklist of things we can all follow to debug production code.

  • Eliminate all the improbable scenarios immediately. In order to do this, it's perfectly fine to add temporary debug code to your production deployment.
    Just remember to remove it after.
  • Don't be afraid to ask co-workers for advice. It's likely that they've seen something like this before. Experience trumps everything when you're stuck.
  • Read, read and then re-read the logs. In my personal experience, lot's of people simply skim the logs and miss out important details in the logs.
  • Don't ignore dependent libraries as potential sources of problems. After all, that is code written by another human.

Lastly, The fact that you had to debug in production means that you couldn't reproduce the error on your local machine. Once all fires are extinguished, spend time fixing this problem.

Full Post here, 15 mins read