Logging best practices
In the free e-book, The Pragmatic Logging Handbook, by Jon Gifford of Loggly (https://www.loggly.com/), Jon proposes the following eight best practices to apply when determining your logging strategy:
- Treat application logging as an ongoing iterative process. Log at a high level and then add deeper instrumentation.
- Always instrument anything that goes out of the process because distributed system problems are not well behaved.
- Always log unacceptable performance. Log anything outside the range in which you expect your system to perform.
- If possible, always log sufficient context for a complete picture of what happened from a single log event.
- View machines as your end consumer, not humans. Create records that your log management solution can interpret.
- Trends tell the story better than data points.
- Instrumentation is NOT a substitute for profiling and vice versa.
- Flying more slowly is better than flying blind. So the debate is not whether to instrument, just how much.
I think...