Structured Application Logging

In addition to filtering existing log events from our applications and services we can also add structured logging to our applications. With structured logs we provide additional context or information about a situation, or highlight that something has occurred. An example of this is a stack trace generated when an error occurs. For diagnostic purposes log entries are hugely useful. There are two ways of deducing useful data from logs:

  • Creating structured log entries at strategic points of our application.
  • Consuming existing log data.

We're going to look at both methods, starting with adding our own log entries.

Application logging primer

Let's look at some basic tenets for application logging. Firstly, in ...

Get The Logstash Book 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.