In this tutorial you will learn about Log4J, which is one of the most used Logging API by the Java programmers. It is fast and easy to use and provides customizable log formats. Here we are providing many examples of the Log4J framework.
Log4J is an Open Source logging framework from the apache foundation. It's a Java based framework and can be used in any java program. It was originally developed by Ceki Gülcü and now its part of Apache Software project.
It can be used by the Java programmers to add logging functionality in the projects. These days most of the Java projects uses Apache Log4J for logging.
It provides powerful yet efficient and fast API for the Java programmers. Java programmers easily uses Log4J in their code to log the error and information messages into a log file.
Log4j simply inserts a log statement in the application code and manage them externally without going back to its application source code. Programmer's can control the logging message with the help of external configuration file e.g. log4.xml or log4j.properties file. The external properties file can be used to set the log format as well as the level of logging (DEBUG, INFO, FATAL etc..)
Let's get started with the Log4J framework:
A simple example of log4j for Servlet
This Example shows you how to create a log in a Servlet.
If you enjoyed this post then why not add us on Google+? Add us to your Circles
Liked it! Share this Tutorial
Post your Comment