Log limitations
Logs are very useful to understand what's happening in a running system, but they have certain limitations that are important to understand:
- Logs are only as good as their messages. A good, descriptive message is critical in making logs useful. Reviewing the log messages with a critical eye, and correcting them when needed, is important to save precious time on production problems.
- Have an appropriate number of logs. Too many logs can confuse a flow, and too few may not include enough information to allow us to understand the problem. Large numbers of logs also create problems with storage.
- Logs should work as an indication of the context of the problem, but likely won't pinpoint it. Trying to generate specific logs that fully explain a bug will be an impossible task. Instead, focus on showing the general flow and surrounding context of the action, so it can be replicated locally and debugged. For example, for a request, make sure...