Pradeep's Blog

Google

Monday, April 03, 2006

Logging Packages’s in Java:

Advantages of logging:

Logging can generate detailed information about the operation of an application. Unlike normal debugging statements they can be easily turned off when not needed and are easy to maintain & increase productivity. Unlike debugging statements logging frameworks allows us to generate output to different destinations like console, files, sockets etc. But the best of all these functionality would be the ability to turn them off and on (either completely or partially) according to our needs.

Logging packages for Java:

My project required me to use a logging framework. So I had to decide on the framework that we would be using. Of the various logging packages, log4j and Java’s own logging API are notable. Both of them have very similar functionality. Logj4 has been around for a long time and is used widely, whereas the java’s logging package was added with jre1.4 in 2003.

Java’s logging package has all the functions that log4j has. In fact it is nearly a copy of log4j with a bit more added to it. The difference is in the areas of appender/handler implementations, formatter/layout implementations, configuration flexibility, and in the levels of logging.

My choice:

Even though log4j is thoroughly tested and very popular, my choice was to go with Java’s own API because it’s already bundled with JRE and moreover has all the functionality that I would need.

0 Comments:

Post a Comment

<< Home