11 Logging frameworks

 

This chapter covers:

  • Examining the typical 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 by using logging frameworks for our application development. Most programming languages these days will be able to use a logging framework. In some cases, the third-party ones predate the language native feature and become something of a de-facto standard. Other logging frameworks have come as part of an application container or platform to address weaknesses perceived or proven in the native solutions.

This chapter will explore the logging framework landscape as there is a range of commonalities in their capability and often in design. A general understanding of this will help us appreciate the 'art of the possible' and make informed decisions when choosing a framework. We will also look at whether the more dominant frameworks for different languages can support the ability to connect directly to Fluentd. Fluentd has also helped us in this space by providing logging libraries for multiple languages, so we'll look at those to understand how they may fit into the options we have.

11.1  Value of logging frameworks

 
 

11.2  Typical structure of a logging framework

 
 
 
 

11.2.1  Logger Context

 
 
 

11.2.2  Appender

 
 

    Logger

 
 

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.1 Python with logging framework – using Fluentd library

 
 
 

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  Porting the Fluentd calls to another language into action.

 

11.7.6  Using generic appenders – the takeaways

 
 

11.8  Summary

 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest