Member-only story

How to Log

How I learned to log exactly the right things and nothing more.

René Reifenrath
3 min readMay 24, 2024

Not a Medium Member? Read here for free.

Logging is something that every developer should do, though it’s hard to find the right balance and not overdo it. That’s why I want to share my learning in this regard. So here are the two mistakes I made along the way in finding the perfect balance.

Thanos from Marvels Avangers holding the infinity gauntlet. The text says “perfectly balanced as all things should be”

1. Not Logging at All

The Mistake: “Nothing can go wrong with my code”, is what a younger me thought sometimes. Little did I know about all the things that can go wrong. Logging was just something that cluttered my code or I had to do it because a senior developer told me to. Without a deeper explanation of why I had to do it, it was just some absurd rule I had to follow. I just hadn’t had the experience yet. It wasn’t until I had to troubleshoot production issues, that I realized what difference good logging can make.

Learning: Logging can save a lot of time and nerves. Troubleshooting will be a lot easier when you log all the relevant information to reproduce the issue. But make sure not to fall in for the next mistake!

2. Overlogging

The Mistake: So “not logging” is an issue, then I’ll make sure that I don’t miss any information that could be relevant at…

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Written by René Reifenrath

I am a software developer from germany. Blogging about programming and tech related topics. I ❤️ open source and privacy.

No responses yet

Write a response