3 ms·
As a counterpoint to what appears to be the main points being made in this discussion: For a team I was technical lead on a number of years back we decided to
by NomDePlum 2y ago
As a counterpoint to what appears to be the main points being made in this discussion:
For a team I was technical lead on a number of years back we decided to only log errors, and only if there was an identified known error path. We also documented the error and what action, if any was expected to be taken.
The team was relatively junior and had up to that point had a habit of scattering debug and info statements through any code touched by the feature under development.
This forced developers to diagnose development issues using better test coverage and to resolve and deal with error paths early.
When we went to production we had alerts that informed us anytime the log size > 0 kB and we investigated and resolved the issue as soon as we could.
It wasn't the most complicated application (online government form for applying for a pension), but did integrate with a number of other systems and deal with a fairly varied number of scenarios. We also had less lines of code and better codebase readability.
No idea if that policy is still in place but it did have a number of benefits.
I've seldom added anything but error or observability logging to anything I've worked on since.