We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Minimal Logging

Logs are a great tool. But it's possible, even easy, to overdo it. There's nothing worse than trying to debug a problem, only to be overwhelmed by a torrent of useless log messages.

I once worked at a company that spent almost as much on their third-party logging service as they did on their cloud provider. They just logged way more than they needed.

I recommend a minimal logging strategy.

  • Don't log the same event more than once
  • Don't log anything you don't care about
  • Don't log events that may resolve automatically (e.g. the first failure of a retry loop)
  • Log at the appropriate severity level
  • Use structured logging to enable better filtering and searching
  • Include timestamps for better event correlation