Terminologies - Log4J - Components of Logging API & Process Flow

 

3 Core Components of Java logging API 

  1. Loggers are responsible for capturing events (called LogRecords) and passing them to the appropriate Appender.
  2. Appenders (also called Handlers in some logging frameworks) are responsible for recording log events to a destination. Appenders use Layouts to format events before sending them to an output.
  3. Layouts (also called Formatters in some logging frameworks) are responsible for converting and formatting the data in a log event. Layouts determine how the data looks when it appears in a log entry.

Process Flow:

When your application makes a logging call, the Logger records the event in a LogRecord and forwards it to the appropriate Appender. 

The Appender then formats the record using a Layout before sending it a destination such as the console, a file, or another application. 

Additionally, you can use one or more Filters to specify which Appenders should be used for which events. Filters aren’t required, but they give you greater control over the flow of your log messages.




Comments

Popular posts from this blog

QA's approach 2 Java - Understanding Static context

QA's approach 2 Java - Collections Framework & Generics Introduction

Technologies - Log4J - Create Log4j Configuration File - Where ? How ? What ?