Main Components of Log4j
Log4j has 3 main components which include Loggers, Appenders, Layouts
Loggers: – It’s a top-level component which is responsible for capturing your application’s information.
Appenders: – It’s a lower level component which is responsible to put logging information into given destination. Means where you want to store your information that will be taken care by Appenders.
Layouts: – This component is responsible for formatting your logging information so that it can be easy to read. It provides support to appender component before publishing log information.
Level: – Level object defines the priority of the information to be logged based on configuration. There are 7 levels of the log which are given below: –
Filter: – Filter components is used to do analysis on logging information and decide whether to log that information or not. Basically, the filter is used by Appender component. All the information should go through the filter before it gets printed.
LogManager: – Log manager is responsible for complete logging framework. It verifies the configuration files and manages and gives direction to all the components involved.