Administration Guide
Overview Guide
Installation Guide
Previous Next Contents



About Logging Server Messages
The message logging service provided by Netscape Application server is configured through the Logging tool of the Netscape Application Server Administrator. With the Logging tool, you can specify the destination and types of messages logged.

The Netscape Application Server and the HTTP Web server generate different messages and require different configuration to properly enable logging. For more information about these differences, see "About Logging Server Messages"and "About HTTP Web Server Logging."

About Logging
Netscape Application Server event logging is recording the messages generated by the application-level and system-level services. These services generate messages when they are invoked and during the time they are running. These messages describe the events that are happening while that service is running.

A service is invoked when an AppLogic object needs that service to process a user's request. For example, when a request comes down the pipe that requires database access, the AppLogic object invokes the data access service. While the data access service is running, it uses the log service to output its messages.

About the Message Types
There are three types of messages generated by the Netscape Application Server services, as described in the following table:

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 non-critical problem that might be an indication to a larger problem.
When a service encounters a temporary problem, such as temporarily unable to connect to a process.
Error message
Describes a critical failure of the service, from which recovery is not likely.
When a service encounter an unexpected problem, such as a pipe closure.

You can set the log service to log the error messages, the error and warning messages, or all of the messages.

About Application Logging
The application developer can also take advantage of the Netscape Application Server logging service and log application generated messages. By using the log( ) method, the application developer can send messages to the same log destination you configure for the Netscape Application Server services. This provides the application developer with a means of debugging and trapping application errors.

For example, if an AppLogic object encounters a problem with completing a segment of code, an error message can be forwarded to the logging service. This error message is whatever the developer chooses to write, so it can potentially pinpoint the exact location of a problem within an application. Of course, the message does not have to be about an error or a problem. The application developer could log informational messages about the application's status.

Application logging requires more planning, but the information you can record is valuable for quickly solving problems and limiting application downtime.

About the Format of a Log Message
The format of a log message generated by the Netscape Application Server has the following four components:

When stored in a database table, the message type and service or AppLogic object ID are numbers. The log service maps those numbers to a string when outputting the message to the other three destination logs.

The event message uses the following syntax when it is output to a process console, an ASCII text file, or the operating system log:

For example, the following messages were output to an ASCII text file and illustrate the actual message format:

About the Logging Destination and Log Buffer
Server and application messages can be logged to any or all of the following destinations, as described by the following table:

Log Destination
Description
When to Use
Process consoles
The Netscape Application Server process consoles can 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 will open and display the log messages.
Operating system log
The default operating system log file. For UNIX, this is under /var/log when automatic startup is enabled or /opt/KIVAes/log. For Windows NT, this is viewable through the Event Viewer.
This is also a default. When you want a more comprehensive record of the server and application error messages. Warning and information messages are not logged to the operating system log. All messages are sorted by their time stamp.
ASCII text file
An ASCII text file, which you must create and specify.
As a more permanent record of the server and application messages. All messages are sorted by their time stamp.
Database table
A database table which you must create and specify.
This is the most powerful and versatile destination to which to log messages. You can sort, group, and create reports of the logged messages.

When you enable Netscape Application Server logging, messages are automatically logged to the operating system and to the process consoles, as long as those consoles are open. Logging to a process console does not record the messages. You cannot retrieve the messages once they scroll off of the screen.

The Netscape Application Server uses a log buffer in which messages are stored before they are written to the operating system, ASCII file, and/or database logs. This optimizes the performance of the Netscape 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.

When the Logging Destination is a Database

If you are going to log Netscape Application Server messages to a database, you need to create the eventlog database table with the four field names as described in the following table. This table also describes the necessary data type for each field name.

On the UNIX system, you can use supplied scripts that automatically set up this eventlog table and the httplog table that is described in the next section. The scripts are in the directory $GX_ROOTDIR/APPS/GXApp/Logging/db, 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.

Use this table as a guide when building the database log table.

Message Component Description
Database Field Name
Field Type
The date and time the message was created.
evttime
Date/Time
The message type, such as information, warning, or error.
evttype
Number
The service or AppLogic object ID.
evtcategory
Number
The message text.
evtstring
Text

The Netscape Application Server logging service maps the message components to the database fields as they are listed in the table. You must use those exact field or column names in your database table.

For information about enabling Netscape Application Server logging, see "Logging Messages."

About HTTP Web Server Logging
You can also use the Netscape Application Server logging service to log the requests that come into the Web server. Web server requests are monitored by the Web connector plug-in. The connector plug-in sends the incoming Web server requests to the Netscape Application Server where that request is processed.

How Web Requests are Logged
A Web server request is divided into components that are managed by the Web server. These components are standardized HTTP variables used by the Web server to manage Web requests. The Netscape Application Server includes a sub-set of these HTTP variables for you to log. You can add variables to the list, however, if you need to log additional information. For more information about adding HTTP variables to the log, see "Adding HTTP Variables to the Log."

On the UNIX system, you can use supplied scripts that automatically set up this httplog table and the eventlog table that is described in the previous section. The scripts are in the directory $GX_ROOTDIR/APPS/GXApp/Logging/db, 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.

Each HTTP variable must be mapped to a database field name within a table that you create.

For example, 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 the Netscape Application Server and their database data types are listed in the following table. Use this table to help you create the database table to which Web requests are logged.

Default HTTP Variables
Default Database Field Name
Datatype
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 must have a field name called logtime in the database table. The time the message is created is assigned by the Netscape Application Server 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, but if you are interested in reading more about mapping HTTP variables to database fields, see "Mapping HTTP Variables to Database Fields."

You must have the Web server communication plug-in module, such as NSAPI or ISAPI, installed and properly configured. This is done automatically during installation, but sometimes you might have to manually configure the Web server. For more information about how to do this, see "Manually Configuring a Web Server."

 

© Copyright 1998 Netscape Communications Corporation