Logging

Producer vs. Consumer


  
  
    
      
    
    
      
    
    
      
    
    
      
    
    
      
    
  
  
  
  Producer
  
  Consumer
  
  Producer
  
  Producer
  
  
  
  
  
  
  
  Libraries
  Application
  Code
  External
  Stdout
  File
  Logging
  Telemetry
  
    
    
  
  
    
    
  
  
    
    
  
  
    
    
  
  
    
    
  
  
    
    
  

In an application, you will typically have many log producers and a single log consumer.

The log producers are where you issue log statements, e.g.: log.info("Everything working!")
These log statements can typically be issued anywhere, whether in a library or in your application’s code itself.
The programming language and logging framework transports the log statements to the log consumer.

The log consumer has to be initialized at the start of the application’s main logic.
It then has to make the received log statements available to one or more external systems, so that they can be viewed by users.