Log4j API is an Apache project. It provides you the logging mechanism. which allows you to direct the debug & error (basically) statments onto a particular file/database/messaging system etc. Its provide a much cleaner way to store the output statment during the program execution. It can record information upto a class level. For ex: You have X, Y, Z ...N classes....lets say Z classe has thrown and exception/error which you logged using Log4j, while finding the rootcause you would see those error/debug files...It will show you the absolute class name as well, if configured so. Log4j is fully configurable using either. properties or .xml. Disadvantage is it take 5 nanoseconds each time to log a statement or when it is invoked.
What is Log4J and it's advantages & disadvantages ?