Sun Java System Web Server 6.1 SP9 Administrator's Configuration File Reference

AddLog

After the server has responded to the request, the AddLog directives are executed to record information about the transaction.

If there is more than one AddLog directive, all are executed.

The following AddLog-class functions are described in detail in this section:

common-log

Applicable in AddLog-class directives.

The common-log function records request-specific data in the common log format (used by most HTTP servers). There is a log analyzer in the /extras/log_anly directory for Sun Java System Web Server.

The common log must have been initialized previously by using the init-clf function. For information about rotating logs, see flex-rotate-init in the Sun Java System Web Server 6.1 SP9 NSAPI Programmer’s Guide.

There are also a number of free statistics generators for the common log format.

Parameters

The following table describes parameters for the common-log function.

Table 4–71 common-log Parameters

Parameter  

Description  

name

(Optional) Gives the name of a log file, which must have been given as a parameter to the init-clf function in magnus.conf. If no name is given, the entry is recorded in the global log file.

iponly

(Optional) Instructs the server to log the IP address of the remote client rather than looking up and logging the DNS name. This will improve performance if DNS is off in the magnus.conf file. The value of iponly has no significance, as long as it exists; you may use iponly=1.

bucket

(Optional) Common to all obj.conf functions.

Examples

# Log all accesses to the global log file
AddLog fn=common-log
# Log accesses from outside our subnet (198.93.5.*) to 
# nonlocallog
<Client ip="*~198.93.5.*">
AddLog fn=common-log name=nonlocallog
</Client>

See Also

record-useragent, flex-log

flex-log

Applicable in AddLog-class directives.

The flex-log function records request-specific data in a flexible log format. It may also record requests in the common log format. There is a log analyzer in the /extras/flexanlg directory for Sun Java System Web Server.

There are also a number of free statistics generators for the common log format. The log format is specified by using the flex-init function call. For information about rotating logs, see flex-rotate-init in the Sun Java System Web Server 6.1 SP9 NSAPI Programmer’s Guide.

Parameters

The following table describes parameters for the flex-log function.

Table 4–72 flex-log Parameters

Parameter  

Description  

name

(Optional) Gives the name of a log file, which must have been given as a parameter to the flex-init function in magnus.conf. If no name is given, the entry is recorded in the global log file.

iponly

(Optional) Instructs the server to log the IP address of the remote client rather than looking up and logging the DNS name. This will improve performance if DNS is off in the magnus.conf file. The value of iponly has no significance, as long as it exists; you may use iponly=1.

bucket

(Optional) Common to all obj.conf functions.

buffers-per-file

Specifies the number of buffers for a given log file. The default value is determined by the server. 

Access log entries can be logged in strict chronological order by using a single buffer per log file. To accomplish this, add buffers-per-file="1" to the Init fn="flex-init" line in magnus.conf. This ensures that requests are logged in chronological order. Note that this approach will result in decreased performance when the server is under heavy load. 

Examples

# Log all accesses to the global log file
AddLog fn=flex-log
# Log accesses from outside our subnet (198.93.5.*) to 
# nonlocallog
<Client ip="*~198.93.5.*">
AddLog fn=flex-log name=nonlocallog
</Client>

See Also

common-log, record-useragent

match-browser

Applicable in all stage directives. The match-browser SAF matches specific strings in the User-Agent string supplied by the browser, and then modifies the behavior of Sun Java System Web Server based upon the results by setting values for specified variables. See match-browser.

record-useragent

Applicable in AddLog-class directives.

The record-useragent function records the IP address of the client, followed by its User-Agent HTTP header. This indicates what version of the client was used for this transaction.

Parameters

The following table describes parameters for the record-useragent function.

Table 4–73 record-useragent Parameters

Parameter  

Description  

name

(Optional) Gives the name of a log file, which must have been given as a parameter to the init-clf function in magnus.conf. If no name is given, the entry is recorded in the global log file.

bucket

(Optional) Common to all obj.conf functions.

Example

# Record the client ip address and user-agent to browserlog
AddLog fn=record-useragent name=browserlog

See Also

common-log, flex-log

set-variable

Applicable in all stage directives. The set-variable SAF enables you to change server settings based upon conditional information in a request, and to manipulate variables in parameter blocks by using specific commands. See set-variable.