Debugging a tricky production issue

willemodendaal
The Curious Coder
Published in
1 min readMay 6, 2020

Debugging a tricky production issue. Here is what I usually do, in order of preference:

  • Replicate locally and step through code to figure out what is going on.
  • Add logs and replicate in production, then use logs to debug. This is only feasible if it is easy to do additional deployments that contain the logging code, and if the issue is in-fact reproducible.
  • Write similar code to what’s running in production (often starting with a copy/pasted variant of the production code), and try to replicate and isolate the issue that way.

Important: Once I’ve found the issue I usually write a unit test or that raises the same error, and then fix the logic.

--

--

willemodendaal
The Curious Coder

Full stack developer and technology geek; Livin’ the dream!