the main important features of log4j would be it is thread-safe we will see that the logger class which may use it either is a synchronized class so whatever the methods we’ll be using on that class these are all synchronized so obviously there is a thread safe and it is optimized for high speed the tracing happens very fast in a logging framework so that’s why we would say that it is optimized for high speed it supports multiple output appenders per logger as I already mentioned we could use console appender we could use file appender so in that way we could use multiple appenders per logger means for every logger we could use multiple offenders it supports internationalization this is something which you don’t have to worry about right now because that it’s something which is called as i18n so log4j has been giving support for i18n as well also as in support for various languages it is not restricted to a predefined set of facilities means you could you could configure the way you wanted to that’s why this logging framework is more of a flexible it is reliable and it is not you know stick to certain rules like like how we you we would use system read out dot println or whatever be you we would use before so this has made a more flexible so and then logging behavior we could set any logging behavior at runtime using the configuration file the concentration file also you would you could you could write dot xml file or you could write dot properties file as we do in so when it comes to different different other frameworks it’s the same way we could write the configuration file and we would injecting it into the program it is designed to handle Java exceptions also from the start and as I mentioned it has various levels called as all trace debug info one error and fatal and also I mentioned that the level which is set for example let’s say if you have set the level as info so the messages from info and above will appear on your console or the file whatever destination have given the format of the log output can be easily changed by extending the layout class so there is a layout class in the in the log4j package so this class would let you to format the way you want to format the output as then you would want the log files to have certain date or you you would like to have certain time stamp on it so all of these you could you know change it or you know format as you want the target of the log output file as well as the writing strategy can be altered by implementations of the appender interface for the two classes that is the console the file these are the these are the class these are the classes which are inheriting the appender interface you could implement these two classes as an L the way you want it to it is a fail stop however although it certainly strives to ensure delivery log4j does not guarantee that each log statement will be delivered to its destination these were some of the features of log4j so in the next lecture we would see what are the advantages as well as disadvantages of this logging framework thank you


Google Plus

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


Apache Kafka Commands Cheat sheet

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


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…


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…