Previous Contents Index DocHome Next |
iPlanet Application Server 6.0 Administration and Deployment Guide |
Chapter 5 Logging Server Messages
This chapter describes the message-logging service provided by iPlanet Application Server.The following topics are included in this chapter:
About the Logging Service
About the Logging Service
You can enable the logging of server messages using the iPlanet Application Server (iAS) message-logging service. The logging service is configured through the iAS Administration Tool Logging window. There you can specify the destination and types of messages logged.When you enable logging, iAS records messages generated by iAS application-level and system-level services. These messages describe the events that occur while a service is running. For example, each time iAS communicates with the database, the logging service records the resulting messages generated by database access service.
Determining Types of Messages to Log
You can log any of the three types of messages generated by iAS services. Each type is described in the following table:
With the logging service, you can record error messages, error and warning messages, or all messages. To choose which type of messages to log, perform the following steps:
Click the Logging button on the iAS Administration Tool toolbar to open the Logging window.
Select the Enable Server Event Log checkbox as shown in the following figure:
In the General area, from the Message Type drop-down box, select Errors, Errors and Warnings, or All Messages.
In the Maximum Entries text field, enter the maximum number of entries that can exist before data is written to the log.
In the Write Interval text field, enter the amount of time (in seconds) that elapses before data is written to the log.
Logging Application Messages
Message logging is also useful for tracking and debugging application errors. By using the log( ) method, application developers can send messages to the same log destination the server administrator configures for iAS services.For example, if an application encounters a problem in a segment of code, you can log the associated error message. Informational messages about the application's status, rather than error messages, are also useful.
How Log Messages Are Formatted
Every log message has the following four components:
date and time the message was created
When a log message sent to the text-based destination logs, it is formatted as follows:message type, such as information, warning, or error
[Date and time of message] Message type: Service ID: Message text
For example, the following messages sent to an ASCII text file illustrate message format:
[01/18/00 11:11:12:0] info (1): GMS-017: server shutdown (host 0xc0a801ae, port 10818, group 'iAS') - updated host database
[01/18/00 11:11:18:2] warning (1): GMS-019: duplicate server (host 0xc0a8017f, port 10818) recognized, please contact iPlanet Communications for additional licenses
Determining the Logging Destination
You can configure the logging service to record server and application messages in any or all of the destinations described in the following table:
When you enable logging, the logging service automatically sends messages to the process consoles on Windows NT and Unix platforms, as long as those consoles are open and console logging enabled. On Windows NT, the logging service also sends messages to the application log. Logging to a process console does not record the messages. You cannot retrieve the messages once they scroll off of the screen.
To enable the logging service and specify the destination of the log messages, perform the following steps:
Click the Logging button on the iAS Administration Tool toolbar to open the Logging window.
iAS uses a log buffer to store messages before they are written to the application log, an ASCII file, and/or database logs. This buffer optimizes the performance of the application server by limiting the use of resources to continually update a log. The buffer is written to the destination when either the buffer interval times out or the number of entries in the buffer exceeds the maximum number allowed.Select the Enable Server Event Log checkbox.
In the Log Target box, choose the type of logging to enable by clicking the desired checkboxes:
- You can disable console logging by deselecting the Log to Console checkbox.
- See in the following section and for more information.
- If you chose to log to a file, that file is created now. See for information about managing log files.
Logging to a Database
If you plan to log application server messages to a database, you need to create an event log database table. The following table describes the four field names and lists each field's data type.
Table 5-3 Logging to a Database Table
The logging service maps the message components to the database fields listed in the table. You must use these exact field or column names in your database table.
To log to database, perform following steps:
Click the Logging button on the iAS Administration Tool toolbar to open the Logging window.
Select the Enable Server Event Log checkbox as shown in the following figure:
In the Log Target box, click the Log to Database checkbox.
In the General box, from the Message Type drop-down box, select Errors, Errors and Warnings, or All Messages.
- Enter the data source, the database name, the table name, and the user name and password necessary for accessing the database.
Click the Apply Changes button to save your changes to iAS Administration Tool.
Logging to a File
iAS Administration Tool's monitoring service allows you to log information about server activity to a file.To log information to a file, perform the following steps:
Click the Logging button on the iAS Administration Tool toolbar to open the Logging window.
Select the Enable Server Event Log checkbox.
In the Log Target box, select the Log to File checkbox.
In the Log to File text field, enter the name of the log file.
In the General box, from the Message Type drop-down box, select Errors, Errors and Warnings, or All Messages.
Click Apply Changes to save your changes to iAS Administration Tool.
Rotating Log Files
If you choose to record server messages in an ASCII file, you can enable log file rotation to regulate when log files are rotated. Since log files are stamped with the time and date they are created, log file rotation helps organize log files into manageable units.To configure log file rotation, perform the following steps:
Click the Logging button on the iAS Administration Tool toolbar to open the Logging window.
Select the Enable Server Event Log checkbox.
Click the Log to File checkbox.
In the Enable File Rotation drop-down box, choose Yes.
From the Rotation Interval drop-down box, select the interval at which log files are rotated or enter a string to indicate when the log file is rotated.
In the General area, from the Message Type drop-down box, select Errors, Errors and Warnings, or All Messages.
- For instance, the following string indicates logging to a new file begins at 1:00 AM every Monday, as well as on the fifteenth of each month:
- The following string indicates logging to a new file begins at 2:00 AM, 5:00 AM, 6:00 AM, and 7 AM every Friday:
Click Apply Changes to save your changes to the iAS Administration Tool.
About Web Server Requests
You can use the iPlanet Application Server (iAS) logging service to log web server requests. Web server requests are monitored by the web connector plug-in. The plug-in sends requests to your iAS machine where they are processed. By logging web server requests, you can track request patterns and other important request information.
How Web Requests Are Logged
A web server request is divided into components. These components are standardized HTTP variables used by the web server to manage web requests. iAS includes a subset of these HTTP variables for you to log. You can add variables to the list if you need to log additional information.
Note On a UNIX system, you can use supplied scripts that automatically set up the HTTP log and event log tables. See for more information.
Each HTTP variable must be mapped to a database field name within a table that you create. For instance, to log the length of the content of a web server request, map the CONTENT_LENGTH variable to a database field named, for example, content_length and defined as a text data type. The default HTTP variables used by iAS and their database data types are listed in the following table. Use this table to help you create the database table for logging web requests.
You must have a field name called logtime in the database table. The time the message is created is assigned by the logging service. The logging service maps that time to the logtime database field. You can rename all of the other database field names.
The fields from the database table are automatically mapped to web server variables in the registry.
You must have a web server communication plug-in module such as NSAPI or ISAPI installed and properly configured. Even though this happens automatically during installation, there may be occasions when you must manually configure the web server.
Logging Web Server Requests
Before you can log web server requests, you must create a database table to hold the request messages. For more information about creating this table, seeTo log web server requests, perform the following steps:
Click the Logging button on the iAS Administration Tool toolbar to open the Logging window.
From the left pane of the Logging window, select the application server responsible for logging web server requests.
In the right pane of the logging window, click the HTTP tab.
- If you have more than one application server, you can specify one server to log web server requests.
Enter httplog in the Data Source field.
Enter the information you use to connect to the database in the Database field. For example, this would be the Oracle SID for an Oracle database.
In the Table Name field, enter httplog.
Enter the user name and passwords with which you connect to the database. Enter the maximum entries.
Enter the write interval.
- This number represents the greatest number of entries that can exist before data is written to the log.
Click Apply Settings to save your changes to your application server.
- This number represents the amount of time that lapses before data is written to the log.
About DSync Logging Options
iAS supports Distributed Data Synchronization (DSync) across multiple iAS for partitioned and distributed applications. DSync provides cluster management and data synchronization across iAS processes. The iAS Administration Tool provides for logging of DSync messages.For more information about distributed data synchronization, see
In addition, you can dump cluster and DSync node data into iasdsync-cluster-XXX.log and iasdsync-node-XXX.log files respectively where XXX represents the port number of an engine.
DSync provides a component based architecture that allows you to choose which components you want to log. All DSync debug messages appear in KXS, KCS, and KJS log files. DSync debug components are the following:Module: Provides data management and appends other DSync components to the log file. When enabled, the methods executed by DSync are logged.
Failover: Provides cluster membership management. When enabled, interactions between servers and how roles change due to failure of servers/engines/network connection are logged.
Token: Provides distributed lock management features. When enabled, interactions between servers for read/write tokens associated with DSync nodes are logged.
Timeout: Provides life cycle management of DSync nodes per timeout specification. When enabled, nodes that are deleted due to timeout are logged.
Messenger: Provides message communication between iAS servers. When enabled, messages that are created, sent, received and processed are logged.
Format of the Cluster Dump Files
Each iasdsync-cluster-XXX.log file consists of the following sections:The cluster information reports how an engine views the current Dsync cluster as follows:
SyncLocal[2]: 0xd00c3643:10822
The message queue information displays the list of messages that are in the DSync queues as follows:
****************************************
*DSync RecvQueue for GXP_DSYNC protocol
****************************************
Message[1]: GXDSYNC_MSG_RECLAIM_RDTOKEN(/dsync41test/K/5)from 0xd00c3643:10818
Format of the DSync Node Dump Files
Each iasdsync-node-XXX.log consists of the following sections:The message queue information displays the list of messages that are in the DSync queues as follows:
****************************************
*DSync RecvQueue for GXP_DSYNC protocol
****************************************
Message[1]: GXDSYNC_MSG_RECLAIM_RDTOKEN(/dsync41test/K/5)from 0xd00c3643:10818
The node data section displays the collection of nodes stored in an engine as follows:
Status: without Read or Write Token
Status: without Read or Write Token
Owner Thread: 0xf6f040 (Id=0xf78d50)
Standard wait queue[1] thread 0xf88670 (Id=0xf883a0)
Standard wait queue[1] thread 0xf89d60 (Id=0xf89a90)
The timeout manager section displays the set of nodes that are managed by DSync timeout manager in the current engine as follows:
****************************************
****************************************
Entry[0]: ID=/dsync41test/S/4, expired 6 seconds ago
Entry[1]: ID=/dsync41test/U/4, expired 4 seconds ago
Entry[2]: ID=/dsync41test/W/4, expired 3 seconds ago
Entry[3]: ID=/dsync41test/V/4, expired 3 seconds ago
Entry[4]: ID=/dsync41test/X/4, expired 3 seconds ago
Entry[5]: ID=/dsync41test/D/5, expired 2 seconds ago
Entry[6]: ID=/dsync41test/Z/4, expired 2 seconds ago
Entry[7]: ID=/dsync41test/A/5, expired 1 seconds ago
Entry[8]: ID=/dsync41test/B/5, 0 seconds till expiration
Entry[9]: ID=/dsync41test/C/5, 0 seconds till expiration
Entry[10]: ID=/dsync41test/E/5, 0 seconds till expiration
Entry[11]: ID=/dsync41test/F/5, 1 seconds till expiration
Entry[12]: ID=/dsync41test/H/5, 2 seconds till expiration
Logging DSync Messages
To log DSync debug messages, perform the following steps:
Click the Logging button on the iAS Administration Tool toolbar to open the Logging window.
From the left pane of the Logging window, select the application server responsible for logging DSync messages.
In the right pane of the logging window, click the DSync tab.
Specify the DSync components you want to log as follows:
Module: Provides data management and appends other DSync components to the log file. When enabled, the methods executed by DSync are logged.
Failover: Provides cluster membership management. When enabled, interactions between servers and how roles change due to failure of servers/engines/network connection are logged.
Token: Provides distributed lock management features. When enabled, interactions between servers for read/write tokens associated with DSync nodes are logged.
Timeout: Provides life cycle management of DSync nodes per timeout specification. When enabled, nodes that are deleted due to timeout are logged.
Messenger: Provides message communication between iAS servers. When enabled, messages that are created, sent, received and processed are logged.
Optionally, click Dump Cluster Info to dump DSync state cluster information to a iasdsync-cluster-XXX.log file where XXX is the port number of an engine.
- When specifying DSYNC components, you do not have to shutdown and restart iAS for changes to take affect.
Optionally, click Dump Node Info to dump DSync state node information to a iasdsync-node-XXX.log file where XXX is the port number of an engine.
- For information about the format of this log file, see Format of the Cluster Dump Files.
- For information about the format of this log file, see Format of the DSync Node Dump Files.
Previous Contents Index DocHome Next
Copyright © 2000 Sun Microsystems, Inc. Some preexisting portions Copyright © 2000 Netscape Communications Corp. All rights reserved.
Last Updated April 25, 2000