Netra Proxy Cache Array User's Manual

Chapter 17 Monitoring Proxy Cache Log Files

This chapter explains how to view and manage the proxy cache service log files. These log files are distinct from the log files accessed through the Log Files link on the Main Administration page. The log files described in this chapter relate only to the activity of the proxy cache service on a Netra Proxy Cache Server.

You view through the Proxy Cache Log Administration page. You reach this page through the Proxy Cache Administration page. See Chapter 3, Loading the Proxy Cache Administration Page," for instructions on loading this page.

Loading the Proxy Cache Log Administration Page

To Load the Proxy Cache Log Administration Page
  1. In the Proxy Cache Administration page, click Log Files.

    The page shown in Figure 17-1 is displayed.

    Figure 17-1 Proxy Cache Log Administration Page

    Graphic

For each type of log file listed in Figure 17-1, you can view or clear the log file. If you choose to clear a log file, you are prompted to confirm the operation. Click OK to confirm.


Note -

Clearing a log file truncates the log file.


The log file types are described as follows:

Proxy Cache Server log

Lists status messages related to the activity of the proxy cache service. By default, this log is turned on.

Proxy Cache Access log

Lists records of all client accesses to the Netra Proxy Cache Server. By default, this log is turned on.

Proxy Cache Hierarchy log

Contains information about which parent or sibling satisfied each request. By default, this log is turned off.

Proxy Cache Store log

A log of items stored in and removed from the cache, with type (protocol), size, and timestamp. By default, this log is turned off.

Configuration Installation Error log

A log of errors that occur when you perform an Install Configuration operation, as described in the Netra Proxy Cache Array Configuration Guide.

Administration Client Error log

A log of errors that occur when the cgi-bin programs run from the administration web pages. This log can be useful when you encounter an unexpected and inexplicable failure when interacting with the web pages.

Administration Server log

A log of the daemon that maintains the configuration database that is, typically, propagated to the hosts in an array.

Administration Server Error and Exception log

Records the stdout and stderr of the daemon referred to in the preceding item. Of use primarily to trained technical personnel.

In the list above, for the proxy cache service, note that server and access logging is enabled and that hierarchy and store logging is disabled. To enable hierarchy and store logging, you must edit the file proxycache.conf, stored in /etc/opt/SUNWoam/config/proxy. In this file, if you want to enable, for example, both types of logging, you must uncomment the lines for cache_hierarchy_log and cache_store_log. In these lines, replace the word none with the location of the proxy cache service log files. The edited lines display as follows:


cache_store_log /var/opt/SUNWcache/cachelogs/store.log
cache_hierarchy_log /var/opt/SUNWcache/cachelogs/hierarchy.log

Following any changes to proxycache.conf, you must use the Install Configuration link, described in Chapter 3 of the Netra Proxy Cache Server Configuration Guide or the Netra Proxy Cache Array Configuration Guide, to make the changes take effect.

Managing Proxy Cache Service Log Files

The Netra Proxy Cache product is shipped with a command-line program, rotlog, that enables you to rotate and back up proxy cache service log files. These files correspond to the following types referred to in the Proxy Cache Log Administration page:

For each type specified in the preceding list, the rotlog command can perform the following functions:

By default on a Netra Proxy Cache Server, rotlog is run by cron, using the following entry:


25 4,12,20 * * * /opt/SUNWcache/sbin/rotlog -M all -S 100

The effect of this cron job is that rotlog rotates all types of logs (the default) at 4:25 AM, 12:25 PM, and 8:25 PM, daily, enforcing a minimum available amount of space of 100 MB (-S 100) for all types of logs (-M all). If the rotlog command encounters less space than specified in an -S option, it deletes log files, starting with the oldest, until the specified amount of space is reached. Using the -M option, you can establish minimum space thresholds for one or more log types (including all log types).

The -M option (specifying log types for which to set minimum space thresholds) is always used in conjunction with the -S option (which sets the minimum space threshold).

You might specify a cron job to use rotlog to copy logs to a remote file server. For example:


15 2 * * * /opt/SUNWcache/sbin/rotlog -F cache -d /pub/logs -h hepa -u anonymous

At 2:15 AM, daily, the preceding command copies logs of type cache (-F cache) to the directory /pub/logs (-d /pub/logs) on the server hepa (-h hepa), using the user id, for ftp purposes, of anonymous (-u anonymous). Following the successful copy operation, rotlog deletes the local log files that were copied.

On a remote host, rotlog renames a copied file to the following form:


<type>.log.YYYYMMDD

where <type> is one of access, cache, store, or hierarchy, YYYY is the current year, MM the current month, and DD the current day.

If there are multiple local files of the same type (for example, access.log.0 and access.log.1), rotlog appends an integer extension to the remote file name, starting with .1 for the oldest file and incrementing with each successive file of the same type. Continuing with our example, access.log.0 and access.log.1 are renamed as follows:

Table 17-1 Local and Remote Log File Names

Local Name 

Remote Name 

access.log.0

access.log.19980202.2

access.log.1

access.log.19980202.1

Note that access.log.1, the local file, is the older of the two files.

In a rotlog command, you can use the -x option to change the format of the file extension of a copied, using the format specifications listed in the strftime (3C) man page. Use of -x can prevent the overwriting of copied files when you copy log files more than once a day. For example, you can modify the preceding cron job as follows:


15 2,12 * * * /opt/SUNWcache/sbin/rotlog -F cache -d /pub/logs \
-h hepa -u anonymous -x %Y%m%d%H%M

This example is the same as the preceding, except:

The addition of hours and minutes to the default file extension prevents the overwriting of copied files.

See the rotlog (1M) man page for a description of all of the rotlog options.