Access Log settings

Overview

The Access Log records a summary of the request and response messages that pass through the API Gateway. By default, the API Gateway records this in the access.log file in the log directory. This file rolls over with a version number added for each new version of the file (for example, access.log.0, access.log.1, and so on).

The Access Log file format is based on that used by Apache HTTP Server. This means that the log file can be consumed by third-party Web analytics tools such as Webtrends to generate charts and statistics.

Log Format

The syntax used to specify the Access Log file is based on the syntax of available patterns used by the Access Log files in Apache HTTP Server. For example:

%h %l %u %t "%r" %s %b

The log format strings in this example are explained as follows:

%h Remote hostname or IP address.
%l Remote logical username.
%u Remote user that was authenticated (for example, Distinguished Name of a certificate).
%t Date and time of the request in Common Log Format.
%r First line of the request that originated at the client.
%s HTTP status code returned to the client in the response.
%b Bytes sent, excluding HTTP headers.


The following extract from the access.log file illustrates the resulting log format:

s1.oracle.com - lisa [09/05/2012:18:24:48 00] "POST / HTTP/1.0" 200 429 
s2.oracle.com - dave [09/05/2012:18:25:26 00] "POST / HTTP/1.0" 200 727 
s3.oracle.com - fred [09/05/2012:18:27:12 00] "POST / HTTP/1.0" 200 596 
................
................
................

For more details on Apache HTTP Server Access Log formats, see the following:

Configure the Access Log

To configure the Access Log in the Policy Studio tree, select the Server Settings node, and click Logging > Access Log. Alternatively, in the Policy Studio main menu, select Tasks > Manage Gateway Settings > Logging > Access Log. To confirm updates to these settings, click Apply changes at the bottom right of the screen.

You can configure the following fields to enable the server to write an Access Log to file:

Enable Apache Access File Logger:

Select whether to configure the API Gateway instance to start writing event data to the Access Log. This setting is disabled by default.

Pattern:

Enter the Access Log file pattern. This is based on the syntax used in Apache HTTP Server Access Log files, for example:

%h %l %u %t "%r" %s %b

For more details, see the section called “Log Format”.

Base Log File Name:

Enter the name of the Access Log file in this field. When the file rolls over (because the maximum file size has been reached, or because the date has changed), a suitable increment is appended to the file name. Defaults to access.

Directory Name:

Enter the directory for the Access Log file. Defaults to the logs/access directory of your product installation.

Log File Extension:

Enter the file extension for the log file. Defaults to .log.

Max Files:

Specify the number of log files that are stored. Defaults to 20.

Max Log File Size:

Specify the maximum size that the log file is allowed reach before it rolls over to a new file. Defaults to 1000 kilobytes.

Roll Over Daily:

Select whether to roll over the log file at the start of each day. This is enabled by default.

[Note] Note

These settings configure the Access Log at the API Gateway level. You can configure the Access Log at the service level on a relative path. For more details, see the API Gateway User Guide.