10 Logging best practices

This chapter covers

  • Applying log levels to filter and prioritize actions
  • Identifying characteristics of good logs
  • Easing operational activities with good logs
  • Understanding the impact of legislation on logs
  • Coding practices for improved logging

The technology used is only as good as the log events themselves, regardless of how log entries are generated, whether applications write to stdout, stderr, OS event frameworks, or logging frameworks. To maximize the technical investment, we need to make the log events and their creation as effective as possible.

We have delved deeply into the technology, so we need to do the same for log events. This chapter will explore what should and should not be logged in terms of business ...

Get Logging in Action now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.