ALUI Development Environment: Debugging

Configuring ALI Logging Utilities

ALI Logging Utilities (formerly Plumtree Logging Utilities) are used to receive messages from the IDK (EDK) and other logging message senders. For details on IDK logging, see Configuring IDK Logging Options.

The ALI Logging Utilities package includes three log message receivers that allow for a wide variety of logging solutions. This page includes instructions on how to configure these receivers. To download the utilities, go to the ALUI Developer Center on dev2dev.

The System Health Monitor is an administrative portal tool that provides real-time access to performance information on remote servers, custom objects and ALI services. To access the System Health Monitor, go to portal administration and click Select Utility | System Health Monitor. For details, see the portal online help.

Logging Levels

There are eight logging severity levels:

Severity Level

Description

Logging Spy
Color Code

Info

Normal but significant event.

   black

Action

Significant action between Info and Warning.

   black

Function

Brackets the beginning and ending of function and puts bracketed message in context.

   black

Performance

A millisecond timestamp (e.g., operation X took # milliseconds) for costly tunable operations.

   green

Warn

Minor problem.

   pink

Debug

Most common and numerous log call, used for detailed call tracing and parameter logging.

   gray

Error

Major problem affecting application function.

   red

Fatal

Blocking problem.

    white on red

Verbose logging levels can be intrusive. Use the Debug logging level only if you are actively debugging; this level of logging will affect the performance of the portal.

ALI Logging Spy

ALI Logging Spy (formerly Plumtree Logging Spy or PTSpy) is the primary log message receiver for ALI’s logging framework. ALI Logging Spy displays log messages from the portal and other ALI products and services. It provides additional features including fine-grained filtering, saved log file display, error highlighting, find, and sort.

The default path to launch ALI Logging Spy in Windows is Start | Programs | plumtree | PT Logging Utilities | Logging Spy. (The shortcut location is configured during installation. If you changed the default, use the location you chose.)

The default path to launch ALI Logging Spy in Unix is: <install directory>/ptlogging/6.0/bin/PTSpy.sh

The buttons below the menus invoke the following features:

Open Existing Log File: Loads a *.spy log file into the log buffer for review.

Save File: Saves the contents of the log buffer to a *.spy log file for later review.

Copy Selection: Copies the selected log message lines into the system clipboard as text. Click the mouse over a line to select it. Use shift+up arrow or shift+down arrow to extend the selection.

Clear Log: Clears the contents of the log buffer.

Set Filters: Invokes the Filter Settings dialog box to change the visibility of various log levels and components.

Start/Stop Logging: A toggle button to start or stop logging. Stopping logging may be useful when many messages are flowing and you want to concentrate on a set of messages already captured by ALI Logging Spy.

Click the Set Filters button to open the Filter Settings dialog. This interface allows you configure which applications to log and which logging levels to retrieve. To add a new application, click Edit | Add Message Sender.

 

In the Add Message Sender dialog box, select the logging application name of the sender from which you wish to receive log messages and click OK. Most ALI components use the naming convention productname.machinename.username. If you do not see an application name for your sender, see the instructions in the Logging FAQ.  

The message sender is displayed as a top node in the Filter Settings dialog. If ALI Logging Spy detects the application on the network, the application components will appear as sub-nodes in the Filter Settings dialog. Under each component sub-node are eight sub-nodes for the eight logging levels.

By default, the Warn, Error, Fatal and Action logging levels are enabled for all components. To change these settings, click the corresponding checkbox or use the Edit menu to make changes that affect multiple components. To revert all components to the default settings, click Edit | Reset Filters. Click Apply or OK to save your changes. (The default settings are defined in an XML configuration file called ptspy.xml. The format of ptspy.xml is similar to that of ptLogger.xml.)

The ALI Logging Spy interface displays enabled logging messages from all application components in the order they are received. The view can be filtered by a range of parameters, including component and severity level (Type).

 

The state of the logging receiver is displayed in the bottom right of the ALI Spy window:

To view the full text of a logging message, copy the line to a text editor. To select the entire line, click Ctrl/C. To select the message text only, click Ctrl/M.  (To paste the text in the text editor, click Ctrl/V.)

If you do not see any messages from your sender, see the instructions in the Logging FAQ.  This page also explains how to configure the memory allowance for ALI Logging Spy.

For details on enabling logging for IDK components, see Configuring IDK Logging Options.

ALI Logger

ALI Logger (formerly Plumtree Logger) runs as an unattended background process that receives log messages from the ALI logging framework and uses the Log4J framework to write the messages to a disk file or other repository. Log4J is an open source logging solution from Apache that comes bundled with a wide variety of solutions for dealing with logging messages. In Log4J terminology, these solutions are called appenders. By taking advantage of Log4J appenders, ALI Logger is also able to deal with log messages in a wide variety of ways.

The primary use of ALI Logger is to save log messages to a disk file, but it can also be used in more exotic ways, such as sending log messages to an e-mail system. This can all be done without any coding, simply by modifying the ptLogger.xml configuration file and adding Log4J appender elements as explained below. The default location for the log files produced by ALI Logger is <install directory>\ptlogging\logs.

Configuring ALI Logger (ptLogger.xml)

ALI Logger uses an XML configuration file called ptLogger.xml (<install directory>\settings\ptlogging). This configuration file specifies which servers the logger should receive messages from, and which Log4J appender(s) should be used for the log messages from each server. Each server can be associated with one or more appenders. You can also specify that only messages at certain logging levels from a given server should be sent to an appender.

The specification for the ptLogger.xml file is as follows.

  1. The root level xml node must be <configuration>. Under <configuration> there are two types of nodes: <appender> and <filters>. There may be zero or more of any of these nodes and they may appear in any order. The syntax and semantics of each node is defined below.

  2. An <appender> node defines the settings for a specific Log4J appender, and must follow the format specified in the Log4J specification, as shown in the example below.

<appender class="org.apache.log4j.RollingFileAppender" name="CollabRollingLogFile">

     <layout class="com.plumtree.openlog.log4jbridge.MyPatternLayout" />

     <!-- The output file name -->
<param name="File" value="c:/collab.log" />

     <!-- The maximum size of each file -->
<param name="MaxFileSize" value="10MB" />

     <!-- The maximum number of files to keep around -->
<param name="MaxBackupIndex" value="1" />

</appender>

  1. The class attribute specifies the Java class of the appender. In this example, the attribute is "org.apache.log4j.RollingFileAppender," so the Rolling File Appender is being specified. This is the appender used most often by the ALI Logger. The purpose of the Rolling File Appender is to save log messages to a disk file with control over the size of the file. When the file gets too big, a new log file will be started. (Logging messages can be forwarded to any Log4J appender.)

  2. The name attribute specifies a user-defined name. It is important to specify a unique and meaningful name for each appender. In the example above, the name is "CollabRollingLogFile" indicating that this appender will be used to save log messages from ALI Collaboration. This name is used in the <filters> node to associate the appender with a server.

  3. The layout element specifies the Java class to use for the layout. This value should never be changed. Every appender node must use the layout class com.plumtree.openlog.log4jbridge.MyPatternLayout.

  4. The <param> node with attribute name="File" specifies the location of the output file. The value attribute should contain the full path to the desired output file.

  5. The <param> node with attribute name="MaxFileSize" specifies how large the file is allowed to grow before a new log file is started. See the Log4J documentation for details.

  6. The <param> node with attribute name="MaxBackupIndex" specifies how many backup log files to keep. See the Log4J documentation for details.

  1. A <filters> node is used to specify a log message sender from which ALI Logger should receive messages and the appender to which messages should be channeled. The filters node defines which logging levels are enabled for each component in the sending application, as shown in the examples below.

<filters server="collab.Foo-w2k.BarryF" appender="CollabRollingLogFile" enabled="true" restrict-to-local="false" >

<component-defaults>
<level enabled="false" value="Debug" />
<level enabled="false" value="Info" />
<level enabled="false" value="Warning" />
<level enabled="true" value="Error" />
<level enabled="true" value="Fatal" />
<level enabled="false" value="Action" />
<level enabled="false" value="Performance" />

<level enabled="false" value="Function" />

</component-defaults>

<component name="Documents">
<level enabled="false" value="Debug" />  
<level enabled="true" value="Info" />

<level enabled="true" value="Warning" />
<level enabled="true" value="Error" />
<level enabled="true" value="Fatal" />
<level enabled="true" value="Action" />
<level enabled="false" value="Performance" />
<level enabled="false" value="Function" />

</component>

</filters>

<filters server="collab.Foo-w2k.BarryF" appender="EmailAppender" enabled="true" >

<component name="Documents">
<level enabled="false" value="Debug" />

<level enabled="false" value="Info" />

<level enabled="false" value="Warning" />

<level enabled="true" value="Error" />

<level enabled="true" value="Fatal" />

<level enabled="false" value="Action" />

<level enabled="false" value="Performance" />

<level enabled="false" value="Function" />

</component>

</filters>  

The <filters> node has two required attributes (server and appender), two optional attributes (enabled and restrict-to-local). Each node has zero or more <component> sub-nodes and an optional <component-defaults> sub-node.

Earlier versions of ALI Logger used a similar XML format that did not allow you to define filters for specific appenders. Every server was mapped to every appender. For backward compatibility, these semantics are still supported.

If you do not see any messages from your sender in the logging file, see the instructions in the Logging FAQ.  

Starting ALI Logger

In Windows, ALI Logger is a Windows service. Start and stop the service by clicking Start | Programs | plumtree | PT Logging Utilities | Logger Start and Logger Stop.

In Unix, ALI Logger is a Unix daemon. Start and stop the daemon using the shell script [install-dir]/ptlogging/6.0/bin/ptLogger.sh. To start the daemon, use the command: ptLogger.sh start. To stop the daemon, use the command: ptLogger.sh stop.

Console Logger

Console Logger is similar to ALI Logger, except that it runs in a console window. Console Logger uses the Log4J console appender to display logging messages in a console window. Console Logger has limited use; in most cases, it is preferable to use ALI Logging Spy.

Console Logger uses an XML configuration file called consolelogger.xml. The format for consolelogger.xml is identical to that of ptLogger.xml (described above). Console Logger ships with one <appender> node in consolelogger.xml:

<appender class="org.apache.log4j.ConsoleAppender" name="Console">

<layout class="com.plumtree.openlog.log4jbridge.MyPatternLayout" />

</appender>

This node uses the Log4J Console Appender which, as the name implies, sends log messages to the console. It is possible to add additional <appender> nodes to consolelogger.xml as with ptLogger.xml, but this approach is uncommon.

Starting Console Logger

To run Console Logger in Windows, execute [install-dir]\ptlogging\6.0\bin\consoleLogger.bat.

To run Console Logger in Unix, execute [install-dir]/ptlogging/6.0/bin/consoleLogger.sh.

 

Next: Configuring IDK Logging Options