hello guys welcome to this lecture so today we will see what is the how is the architecture of log4j log4j api allows a layered structure where each layer provides different objects to perform different tasks so there are different layers this layered architecture makes the design flexible and easy to extend in future so there are two types of objects available with log-log forge a framework one is core objects and the next a support objects the core objects are mandatory objects of the framework they are required to use the framework whereas support objects these are optional objects and they support code objects to perform additional but important tasks so what our core objects as we have previously discussed like there are logger layout appender so on so we will see what in detail what are these core objects include logger object this this is a top layer in the logger which provides the logger object as I said if you are writing any class you could call the logger on that particular class by saying logout get logger and followed by the class name so it it provides the logger object the logger object is responsible for capturing logging information and they are stored in a namespace hierarchy then comes layout object the layout layer provides objects which are used to format logging information in different styles as we all know layout is nothing but we have will we will be formatting how we want a particular file or a particular particular thing to be so it provides support to appender objects before publishing logging information so using layout object you could you could layer you could design a layout as in how a logging information should be displayed as in you could use a timestamp you could use what it was wartime it was in and so on so it provides the layout support layout objects play an important role in publishing logging information in a way that is human readable and reusable offender object this is the lower-level layer which provides offender objects the appended object is responsible for publishing logging information to various preferred destinations such as it could be the database it could be a file console etc then come support objects so as we have seen that these are optional objects but however they provide support to the core objects in order to perform a certain work so there are important objects there are other important objects in the log4j framework that play a vital role in the logging framework first is the level object the level object defines the granularity and priority of any logging information as I mentioned there are seven levels of logging defined within this API of debug info error 1 fatal and all so these are various levels which you could set depending upon your need filter object the filter object is used to analyze logging information and make further decisions on whether that information should be logged or not so you will you will keep this object as as to decide later on whether you want to keep it or not but however you would lock log that information and appender objects can can have several filter objects associated with them if logging information is passed to a particular offender object all the filter objects associated with that offender need to approve the logging information before it can be published to the attach destination then it then comes object render the object renderer object is specialized in providing a string representation of different objects pass to the log logging framework this is used by layout objects to prepare the logging information then log manager the log manager object manages the logging framework so whenever you call as I mentioned earlier when when you are using a logger object you would say logger don’t get logger so logger dot get logger would in turn call log manager get logger which I will show you which I will show you where when we are doing the practical so this log manager is the object which manages the logging framework it is responsible for reading the initial configuration parameters from a system-wide configuration file or a configuration class so in the next lecture we’ll see how to configure log4j thank you

Tags:






Youtube
Facebook
Google Plus
Twitter
TutorialDrive


Apache Zookeeper Tutorial

Apache Kafka Tutorial

Apache Kafka Security

Elasticserarch n Kibana

Java 8 Tutorial

Log4J Tutorial

Apache Storm Tutorial

SQLite Tutorial

Apache Ant Tutorial

Related Posts

blog

Apache Kafka Commands Cheat sheet

Spread the loveKafka Topics List existing topics bin/kafka-topics.sh –zookeeper localhost:2181 –list Purge a topic bin/kafka-topics.sh –zookeeper localhost:2181 –alter –topic mytopic –config retention.ms=1000 … wait a minute … bin/kafka-topics.sh –zookeeper localhost:2181 –alter –topic mytopic –delete-config retention.ms
Read more…

blog

What is Apache Maven | Apache Maven complete tutorial from scratch pdf

Spread the love In this post you will learn the complete tutorial of Apache Maven build tool What is Maven ? Apache Maven is a software project management and comprehension tool. Based on the concept
Read more…

blog

Practical Guide for Web Development in 2018

Spread the loveWelcome to my practical guide  for web development in 2018 in terms of  technology and career. Before we start I just want to  mention a few things, you don’t need to learn  everything that
Read more…