Logging with Context
When troubleshooting an issue with logs, it’s often fairly easy to find an important log; for example, an exception is logged and an alert is fired. Once you find an exception in the logs, the trickier part can be understanding why the exception was thrown. One common approach to this problem is looking at the surrounding logs. Logs are typically in chronological order, so if you see an exception, look at the logs’ lines from just before the exception occurred.