chapter eleven

11 Logging frameworks

 

This chapter covers:

  • Examining the common characteristics of logging frameworks,
  • Selecting logging frameworks for application development,
  • Connecting logging frameworks directly to Fluentd,
  • Sending log events from our applications directly to Fluentd without a logging framework.

In the previous chapter, we looked at how we can create log events that can be used to give the most meaning and value. Another significant way we can easily derive more value from logs is through the use of logging frameworks for our application development. Most programming languages these days will provide a logging framework. In some cases, the third-party ones predate the language native feature and become something of a de-facto standard. Other frameworks have come about as part of delivering an application container or platform or to address weaknesses perceived or proven in the native solutions.

11.1  Value of logging frameworks

11.2  Typical structure of a logging framework

11.2.1    Logger Context

11.2.2    Appender

11.2.4    Filter

11.2.5    Formatter

11.2.6    Configuration

11.2.7    Logger Config

11.3  Appender Structures

11.4  Logging framework Landscape

11.5  Choosing a framework

11.5.1    Putting optimizing application logging into action

11.6  Fluentd’s own logging and appenders

11.7  Illustrations of an application logging directly to Fluentd

11.7.2    Invoking Fluentd appender directly

11.7.3    Illustration with only Python’s Logging

11.7.4    Illustration without Python’s logging or Fluentd Library

11.7.5    Putting porting the Fluentd calls to another language into action.

11.7.6    Using Generic Appenders – The Takeaways

11.8  Summary