Coding Confessions
  • About
  • Confessions
  • Events
  • MAKE A CONFESSION
background

Confession

Turn off your debug output when deploying to production

What’s the background?

I was developing web applications in the era before cloud servers. I would develop code and hand it over to another team who would do a little testing before deploying it to the live system.

What happened?

I had developed some new code. During this process I wrote a few of my own tests, but also added some debug print statements. These print statements saved their output into a logfile. I got the application to a point where I was pretty sure everything was working and I handed it over to be deployed.

A few weeks later I got a call a few weeks later saying that the app has crashed the server. My initial reaction was denial, it couldn’t possibly be my app which was causing this. But I had forgotten to turn off the debugging print statements and my app had created a large logfile, run the server out of disk space and caused it to crash.

What did I learn?

  • Turn off your debugging print statements before going into production.
  • Get somebody else to stress test your code before deploying it.
  • If you receive code from somebody else to deploy, stress test it first.
  • Anika Cawthorn

    By Anika Cawthorn

    Senior Research Software Developer at University College London

  • September 2022
  • Submit a confession to us
  • Read confessions from the community
  • Run your own event
  • Watch previous events
Coding Confessions

Normalising failure in
research software

Learn more

  • About the project
  • Read confessions
  • Submit a confession
  • Organising an event
  • Privacy and licenses
  • Github repository

Software Sustainability Institute

The Coding Confessions project evolved as part of a hack day event at the Collaborations Workshop 2021. The Software Sustainability Institute cultivates better, more sustainable, research software to enable world-class research.

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution 4.0 International License.

© 2021 Coding Confessions

Menu