Portlet Factory, Version 6.1.2
Overview: application logging
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:
- log4j Logging
- WebSphere Portlet Factory provides built-in log4j logging that you can manipulate through various property settings.
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.
- Builder-based Logging
- 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: Working with WebSphere Portlet Factory
- Logging application behavior
To debug an application, log the output of arbitrary actions and methods during execution.
- Changing the default logging level
Edit a properties file to change what is logged by default.
- Viewing a log
To view a log, navigate to the log file and open it in a text editor.
- About using built-in logging in Web Service Call and SQL Call builders
The Web Service Call and SQL Call builders connect to resources outside of your working model. Therefore, it is useful in development to be able to log the events that occur within these builders to ensure that the data from the resources is being accessed correctly.
- Overview: debugging an application
There are multiple ways to determine the cause of problems occurring in a web application.
Library | Support |