Hacker News new | ask | show | jobs
by ziml77 105 days ago
This is the way I like to do it. I know bloating the logs too much can be a problem, but it's even worse if you're lacking information to reconstruct what happened when there ends up being a problem. And only providing that detail when there's an error isn't enough. What if the issue never triggered an error in the application and it was only caught later on either by a person seeing something was off or by an error a downstream system?

Also it's helpful to log before operations rather than after because if a step gets stuck it's possible to know what it's stuck on.