Typically you debug an application by logging the output of arbitrary actions and methods during model execution.
However, the traditional means of placing System.out.println()
statements in the code and later removing them prior to shipment is both tedious and error prone. In IBM® WebSphere® Portlet Factory, you can get the same degree of information by defining methods that can output to log files or the system console. And you can control the behavior of these methods through central logging properties.
The following ways of logging application behavior are provided in WebSphere Portlet Factory:
WebSphere Portlet Factory provides built-in log4j logging that you can manipulate through various property settings. Builder-based Logging
In addition, you can specify your own log4j calls, using builders to create log4j methods and calling those methods to output to log files or the system console. After inserting these calls anywhere within the application where information is required, you can control their activation through the same property settings.
Certain WebSphere Portlet Factory builders provide built-in logging functionality.
You can manipulate this functionality individually for each builder, or you can managed logging centrally for the model through the Debug Inputs panel or by profiling.
What is tracked by logging
The log4j standard provides a means of logging messages of various priority levels when certain events within the program occur. Events is a relative term. The log4j information logging feature is really nothing more than a method that is being called, but only at a certain priority level. So events can be best defined as a location in the program where you place a logging method to be called. Remember, that the log4j information logging feature is synonymous with placing a System.out.println()
(in Java) or printf()
(in C and C++), only with priority levels.
The message that is logged is entirely up to the developer because you can pass any Java Object as the message into the log4j methods. This allows the developer to write variables, method calls, and actions to the logs.
Parent topic: Debugging a IBM WebSphere Portlet Factory application