Logging is one of the best practices in software development. A good codebase is a codebase that contains logging for important events and actions over time in an automated way.
But let’s be honest, when we are working on a project, we always have the debt of missing logging in some important areas of the code. That’s because of many factors. Some of them are time constraints, budgets, the small size of the project, or not having enough users to implicitly push you to log things, and so on.
But when we have incidents, support requests, or new requests from customers, then we are pushed to add logging to our logic as a way to discover, investigate when needed, and fix issues quickly. At this point, we can say that we have started improving our codebases with these kinds of watchers in terms of logging.
All of what I’ve written above was adapted to the old way of writing code. Now we are relying on AI, LLMs, and AI agents for writing code. Does this deserve a pause to analyze our way of using logging now? I can say yes.
We should give logging the same importance that we give to best practices, AI usage, design patterns, and clean, reusable code, because now we have many black-box blocks of code in our codebases, even if we review them manually and even with AI reviewers as well. Logging is now a must so we can figure things out much quicker and fix them much, much quicker.