Previous     Contents     Index     DocHome     Next     
iPlanet Application Server Administrator's Guide



Chapter 4   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

You can enable the logging of server messages using the iPlanet Application Server message-logging service. The logging service is configured through the iPlanet Application Server Administration Tool Logging window. Here you can specify the destination and types of messages logged.

When you enable logging, iPlanet Application Server records messages generated by iPlanet Application Server application-level and system-level services. These messages describe the events that occur while a service is running. For example, each time iPlanet Application Server communicates with the database, the logging service records the resulting messages generated by database access service. Log files are stored in different servers. Logs pertaining to administration and deployment are stored in the Administration Server, known as KAS. The other servers that store message and event logs are KJS (Java Server), KCS (C++ Server) KXS (Executive Server). KAS starts the other three servers and monitors their activities.

This section includes the following topics:


To Determine Types of Messages to Log

You can log any of the three types of messages generated by iPlanet Application Server services. Each type is described in the following table:


Table 4-1    Log Message Types

Message type

Description

When it might appear

Information message  

Describes the processing of a request or normal service activity, such as a status update.  

When no problems arise.  

Warning message  

Describes a noncritical problem that might be an indication of a larger problem.  

When a service encounters a temporary problem, such as when it is unable to connect to a process.  

Error message  

Describes a critical failure of the service, from which recovery is not likely.  

When a service encounters a critical problem, such as a pipe closure.  

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 tasks:

  1. Click Logging on the iPlanet Application Server Administration Tool (iASAT) toolbar to open the Logging window.

  2. In the left pane of the Logging window, select the iPlanet Application Server node for which you want to specify log settings.

  3. In the right pane of the Logging window, click the Server tab. The following dialog box appears:



  4. Mark the Enable Server Event Log checkbox, to enable event logging.

  5. In the General pane, from the Message Type drop-down box, select one of these; Errors, Errors and Warnings, All Messages.

  6. In the Maximum Entries text field, specify the maximum number of entries that can exist before data is written to the log.

  7. In the Write Interval 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 that the server administrator configures for iPlanet Application Server 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

  • message type, such as information, warning, or error

  • service or application component ID

  • message text

When a log message is sent to the text-based destination logs, it is formatted as follows:

[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:


Table 4-2    Message Logging Destinations  

Log destination

Description

When to use

Process Consoles  

iPlanet Application Server process consoles display log messages as they are generated.  

This is the default. If logging is enabled and the server is enabled for automatic startup (UNIX) or interaction with the desktop (NT), the consoles open and display the log messages. To disable this feature, deselect the Log to Console checkbox.  

Application log  

The default application log file. For Windows NT, this can be viewed through the Event Viewer.  

This is the default. Warning and information messages are not logged to the application log. The application log provides a more comprehensive record of the server and application error messages.

All messages are sorted by their timestamp.  

ASCII text file  

An ASCII text file, which you must create and specify.  

Use when you want a more permanent record of the server and application messages. All messages are sorted by their timestamp.  

Database table  

A database table which you must create and specify.  

This is the most versatile logging destination. Use when you want to sort, group, and create reports of the logged messages.  

When you enable logging, the logging service automatically sends messages to the process consoles on Windows and Solaris platforms, as long as those consoles are open and console logging is enabled. On Windows, 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 tasks:

  1. Click Logging on the iASAT toolbar to open the Logging window.

  2. Select the iAS node for which you want to specify log settings.

  3. In the right pane of the Logging window, click the Server Event tab.

  4. In the Server Event tab, mark the Enable Server Event Log checkbox.

  5. In the Log Target box, choose the type of logging to enable, by marking the required checkboxes:

    • Log to Console

    • Log to Windows NT Application Log (Errors Only)

    • Log to File

    If you chose to log to a file, that file is created now. See To Rotate Log Files for information about managing log files.

    See To Log to a Database in the following section and To Log to a File for more information.

iPlanet Application Server uses a log buffer to store messages before they are written to the application log, an ASCII file, and/or database logs. If a log is updated continuously, the time taken for this effort will negatively affect the performance of the application server. This buffer limits the use of resources by storing messages, till a log is updated. 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.


To Log to a Database

If you want 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.



Note On both Windows and Solaris systems, you can use supplied scripts that automatically set up the eventlog and httplog tables. The scripts are located in the directory <iASInstallDir>/ias/ias-Samples/dblog/src/schema, and are named Log_db2.sql, Log_ifmx.sql, Log_mssql.sql, Log_ora.sql, and Log_syb.sql. Choose the script that is appropriate for the database you're using.




Table 4-3    Logging to a Database Table

Database field name

Description

Data type

evttime  

Date and time the message was created  

Date/Time  

evttype  

Message type, such as information, warning, or error  

Number  

evtcategory  

Service or application component ID  

Number  

evtstring  

Message text  

Text  

evtid  

Event ID  

Number  

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 a database, perform following tasks:

  1. Click Logging on the iASAT toolbar to open the Logging window.

  2. In the left pane of the Logging window, select the iAS node for which you want to specify log settings.

  3. In the right pane of the Logging window, click the Server Event tab.

  4. In the Server Event tab, mark the Enable Server Event Log checkbox.

  5. In the Log Target box, click the Log to Database checkbox, as shown in the following figure:



    Specify the data source, the database name, the table name, and the user name and password necessary for accessing the database.

  6. In the General box, from the Message Type drop-down box, select Errors, Errors and Warnings, or All Messages.

  7. Click Apply Changes to save your changes to iASAT.


To Log to a File

iASAT's monitoring service allows you to log information about server activity to a file.

To log information to a file, perform the following tasks:

  1. Click Logging on the iASAT toolbar to open the Logging window.

  2. In the left pane of the Logging window, click the Server Event tab.

  3. In the Server Event tab, mark the Enable Server Event Log checkbox.

  4. In the Log Target pane, mark the Log to File checkbox.

  5. In the Log to File text field, enter the name of the log file.

  6. In the General box, from the Message Type drop-down box, select Errors, Errors and Warnings, or All Messages.

  7. Click Apply Changes to save your changes to iASAT.


To Rotate Log Files

Log files can be rotated when a set period ends. For example, you can specify that your log files are rotated every 10 days, or every Wednesday, so that only the current logs exist in the log file. Since log files are stamped with the time and date on which they are created, log file rotation helps organize them into manageable units.

If you choose to record server messages in an ASCII file, you can enable log file rotation to regulate the entries periodically.

To configure log file rotation, perform the following tasks:

  1. Click Logging on the iASAT toolbar to open the Logging window.

  2. Select the iPlanet Application Server node for which you want to specify log settings. The following figure appears:



  3. In the right pane of the Logging window, click the Server Event tab.

  4. In the Server Event tab, select the Enable Server Event Log checkbox.

  5. Mark the Log to File checkbox.

  6. Choose Yes from the Enable File Rotation drop-down list.

  7. Select the interval at which log files are to be rotated, from the Rotation Interval drop-down list. You can also enter a string to indicate when the log file is rotated.

    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:

    1:0:0 1/15/*

    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:

    2, 5 - 7:0:05/*/*

  8. In the General pane, from the Message Type drop-down box, select Errors, Errors and Warnings, or All Messages.

  9. Click Apply Changes to save your changes to iASAT.



About Web Server Requests

You can use the iPlanet Application Server 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 iPlanet Application Server instance, where they are processed. By logging web server requests, you can track request patterns and other important request information.

This section includes the following topics:


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. iPlanet Application Server 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 both Windows and Solaris systems, you can use supplied scripts that automatically set up the HTTP log and event log tables. See To Log to a Database, 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 iPlanet Application Server 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.


Table 4-4    HTTP Variables and Database Data Types

Default HTTP variables

Default database field name

Data type

Not applicable
 
logtime
 
Date/Time
 
CONTENT_LENGTH
 
content_length
 
Number
 
CONTENT_TYPE
 
content_type
 
Text
 
HTTP_ACCEPT
 
accept
 
Text
 
HTTP_CONNECTION
 
connection
 
Text
 
HTTP_HOST
 
host
 
Text
 
HTTP_REFERER
 
referer
 
Text
 
HTTP_USER_AGENT
 
user_agent
 
Text
 
PATH_INFO
 
uri
 
Text
 
REMOTE_ADDR
 
ip
 
Text
 
REQUEST_METHOD
 
method
 
Text
 
SERVER_PROTOCOL
 
protocol
 
Text
 

You can rename all the database field names except the logtime fieldname in the database table. The logging service maps that time that the message was created to the logtime database field.

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.


To Log 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, see How Web Requests Are Logged.

To log web server requests, perform the following tasks:

  1. Click Logging on the iASAT toolbar to open the Logging window.

  2. From the left pane of the Logging window, select the iPlanet Application Server responsible for logging web server requests.

    If you have more than one instance of iPlanet Application Server, you can specify one server to log all web server requests.

  3. In the right pane of the logging window, click the HTTP tab.

    The following window appears:



  4. Enter httplog in the Data Source field.

  5. Provide 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.

  6. In the Table Name field, enter httplog.

  7. Provide the user name and password with which you connect to the database.

  8. Enter a number in the Maximum Entries field. This number represents the greatest number of entries that can exist before data is written to the log.

  9. Specify the required value in the Write Interval text field.

    This number represents the amount of time that lapses before data is written to the log.

  10. Click Apply Settings to save your changes.



About The Administration Server

The administrative services of iPlanet Application Server run in the Administration Server process (KAS) This Administration Server enables remote administration of servers and applications. KAS also supports other services, such as application partitioning, event logging, request monitoring, and dynamic configuration of key server settings. Clients that access administrative services include iASAT, Directory Server and third party SNMP agents.

Some of the events that are monitored and logged by KAS are listed below:

  • Server login and logout details.

  • Initialization status, startup, shutdown, enabling and disabling of server and engines.

  • Issues related to KAS, SNMP, Transaction Manager and engines.

  • Issues related to iPlanet Application Server installation.

  • Deployment actions and errors during deployment.

  • Errors that may occur when retrieving configuration parameters for LDAP, databases, database clients, transactions, resource manager, logging, load balancing, engines and KAS.



About DSync Logging Options

iPlanet Application Server supports Distributed Data Synchronization (DSync) across multiple iPlanet Application Server for partitioned and distributed applications. DSync provides cluster management and data synchronization across iPlanet Application Server processes. iASAT provides for logging of DSync messages.

For more information about distributed data synchronization, see This section includes the following topics:


How DSync Messages Are Logged

    • 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 iPlanet Application Server servers. When enabled, messages that are created, sent, received and processed are logged.

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.


Format of the Cluster Dump Files

Each iasdsync-cluster-XXX.log file consists of the following sections:

  • Cluster

  • Message queue

The cluster information reports how an engine views the current Dsync cluster as follows:

****************************

*DSync Cluster State

***************************

Host: 0xd00c3643

Port: 10818

Role: SyncPrimary

Current Engine's order #:1

SyncPrimary: this engine

Is connect to primary? NO

Changing primary? NO

Max number of SyncBackup#=1

SyncLocal[1]:0xd00c3643:10821

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:

  • Message queue

  • Node Data

  • Timeout Manager

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:

****************************

*DSync Token State

***************************

[1] ID:/

   Status: without Read or Write Token

   Scope: GLOBAL

[2} ID:/dsync41test

   Status: without Read or Write Token

   Scope: GLOBAL

   Owner Thread: 0xf6f040 (Id=0xf78d50)

   Standard wait queue[1] thread 0xf88670 (Id=0xf883a0)

   Standard wait queue[1] thread 0xf89d60 (Id=0xf89a90)

   Child[0]:B

   Child[1]:A

   Child[2]:D

   Child[3]:C

   Attribute[NextPath]:N

[3]..

The timeout manager section displays the set of nodes that are managed by DSync timeout manager in the current engine as follows:

****************************************

*Timeout Manager State

****************************************

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


To Log DSync Messages

To log DSync debug messages, perform the following tasks:

  1. Click Logging on the iASAT toolbar to open the Logging window.

  2. From the left pane of the Logging window, select the iPlanet Application Server responsible for logging DSync messages.

  3. In the right pane of the logging window, click the DSync tab.

    The following window appears:



  4. Specify the DSync components you want to log. See Format of the DSync Node Dump Files for more information on DSync components that you log.

    When specifying DSYNC components, you do not have to shutdown and restart iPlanet Application Server for changes to take affect.

  5. (Optional) 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.

    For information about the format of this log file, see Format of the Cluster Dump Files.

  6. (Optional) 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 DSync Node Dump Files.



About Monitoring iPlanet Application Server Log Files

This section describes how application server logs can be viewed, on Windows and Solaris systems. Reviewing log files is often helpful when troubleshooting application and server configuration problems. The following sections describe in detail how you can monitor iPlanet Application Server logs on both Windows and Solaris systems.

This section includes the following topics:


To Monitor Application Server Logs on Windows

To enable display of application server logs on NT, perform the following tasks:

  1. From the Start menu, select Settings>Control Panel

  2. Double-click the Services icon. The Services window appears, as shown in the following figure:



  3. Select iPlanet Application Server 6.0.

  4. Click Startup. The Service window appears, as shown below:



  5. Mark the Allow Service to Interact with Desktop checkbox, as shown in the figure.

  6. Click OK to close the window.

  7. In the Services window, click Stop to stop iPlanet Application Server.

  8. Click Start to start iPlanet Application Server again.

When you do this, you will see iPlanet Application Server logs messages displayed in MSDos windows. Each physical process in iPlanet Application Server will be displayed in a separate window. For example, you can see KAS logs, KJS logs and KCS logs in separate windows.


To Enable Vertical Scroll Bars In The Output Windows

The log messages that you view on the MSDos windows will scroll continuously. To You can enable vertical scroll bars in the output windows, and scroll backwards and forwards to view the messages you want. To enable vertical scroll bars in MSDos windows, perform the following tasks:

  1. Click the MSDos icon at the upper-left corner of the output window.

  2. Choose Properties. The Properties window appears, as shown in the following figure:



  3. Select the Layout tab.

  4. Set the Screen Buffer Size Height to 200 or more.

  5. Click OK to register your changes. A confirmation window appears, as shown below:



  6. To enable scroll bars on all MSDos windows, mark the Save Properties for future windows with same title radio button.


To Monitor Application Server Logs On Solaris

On Solaris, you can view iPlanet Application Server logs by using a command line tool. Using this tool, you can selectively view the messages you want. For example, you can view messages generated during a specific period, or view only the first few messages in a file.

To monitor iPlanet Application Server logs on Solaris, perform the following tasks:

  1. Navigate to the following path:

    <iasinstsall>ias/logs

  2. Type tail - and the filename of the log file that you want to view. For example, to view KJS logs, type tail -kjs.

To stop the command execution, press CTRL+C.

.


Note Open a terminal window and type man tail for a complete list of all the options you can try with the tail command.




Previous     Contents     Index     DocHome     Next     
Copyright © 2001 Sun Microsystems, Inc. Some preexisting portions Copyright © 2001 Netscape Communications Corp. All rights reserved.

Last Updated June 25, 2001