Skip to main content

Posts

Showing posts with the label Log4j

Log4j : Debugging Concepts - Part-4

Appenders Having all of your log requests scrolling on your console is not what you need all of the time. In fact limiting your log requests to your screen only violates all what we mentioned in the previous tutorial about how flexible logging is if compared to the use of traditional debuggers. One sometimes wants to save his log requests in the form of disk files for later analysis. These files can be used for the purpose of auditing as well. In some cases, you may want to see your log requests on a machine different from the one over which your application is running. As you can see, all these scenarios, and of course many other scenarios that are not mentioned here, are all about where the output of your log requests will go. When we speak about the destination to which your log requests will be delivered then we are essentially talking about an important log4j concept: Appenders.

Log4j : Debugging Concepts - Part-3

What we already have and what we do not? In the previous tutorial we introduced you to the central concepts of log4j. Although, with just that amount of information we presented in the previous tutorial, you are able to use some log4j aspects, you are still in need to grasp some more advanced points to reveal the full power of log4j. An interesting feature of log4j is that you can make use of it with just a little amount of knowledge about it and in the same time a developer who is keen to utilize it's full power can acquire at least a linear (or should we say exponential?) effort / benefit curve. By now, you should be familiar with what is logging and for what purposes should we use it. You should have the skill of deciding when to use (or not to use) logging. The major central concepts (e.g., loggers, appenders, and layouts) of log4j should be present in your mind as well. We are going in this tutorial to reveal more about these central concepts, to present ne...

Log4j : Debugging Concepts - Part-2

What is log4j? Log4j is a popular library of ready Java classes that enable you to easily implement logging for your Java applications. Being used as a logging tool for huge reputable applications (like IBM's NetView), log4j is known for it's efficiency and flexibility. Log4j is the result of the countless efforts made by the E. U. SEMPER project in 1996 and is currently being distributed under the Apache Software License; or more simply an open source license. What is our working environment / platform ? Any Java developer with average experience can easily adapt the use of log4j for his own working environment. For reference purposes, we are documenting here what environment we used in this tutorial : Operating system: Microsoft Windows XP Professional SP2 JDK: J2SE Development Kit 5.0 Update 6 Log4j: Version 1.2.13 How to install log4j? The installation of log4j is rather simple. First of all download it from link [5] below. It comes in form of ...

Log4j : Debugging Concepts - Part-1

Who are you? If you or your client once discovered a bug in your application and never being able to reproduce it again. If you once felt that your too late discovered application bug let you down by reducing your reputation in front of your client. If you are not completely satisfied with the traditional debugger you are using or even have no access to a debugger at all. If you ever set in front of your running application wondering what it's doing now and what exact parts of it are currently being executed. You are already familiar with Java know how to compile your code, and how to use JDK. If you are any one of the those people then please read on ... logging is for you! Introduction Every time we attend a meeting or a conference that is some how related to debugging, we frequently hear the famous statement: 'Fixing bugs is not easy!'. Our experience shows that fixing bugs is rather easy. What makes people think like that is they topic...