Configuring logging

To customize logging, you can use the Configuration and Administration forms or edit directives in the proxy configuration file. You can set the following options:

About logs

Caching Proxy can create three types of access logs, in addition to an event log and an error log:

Caching Proxy creates new log files each day at midnight. If the proxy is not running at midnight, new logs are created the first time it is started that day. You can specify the directory and file name prefix for each log file; each log file that is created also contains a date suffix in the form .Mmmddyyyy (for example, .Apr142000).

Because logs can use a large amount of space, consider storing your log files on a storage device that is separate from the operating system and cache, to prevent errors. In addition, configure log maintenance routines, as specified in Maintaining and archiving logs.

Log file names and basic options

To specify the basic configuration of the proxy server logs, in the Configuration and Administration forms, select Server Configuration -> Logging -> Log Files. Specify the path and file name for each log file that you want to use. The current file name for each log is displayed in the corresponding text box; if you have not specified a path, the default path is displayed.

Information that is logged into the proxy logs is not automatically written to the system log, but you can configure Caching Proxy to write to the system log in addition to or instead of to its own logs. On the Log Files form, select the Log information to Syslog check box. Note that the system log must be created before this option is chosen.

To specify that proxy server log information is written only to the system log, you must edit the proxy configuration file; see the reference section for LogToSyslog -- Specify whether to send access information to the system log (Linux and UNIX only).

Related configuration file directives

To set up logs by using the proxy configuration file, see the reference sections in Appendix B. Configuration file directives for the following directives:

Access log filters

Access logs record the activity of the host machine, the proxy, and the cache. For each access request that your proxy receives, an entry in the appropriate access log includes the following information:

Access errors are logged in the server's error log.

Reasons to control what is logged

There are several reasons to restrict what is logged:

Information that is excluded from access logs is not recorded in any access report and is not available for future use. Therefore, if you are unsure about how much access information you need to track, apply exclusion filters conservatively until you gain experience in monitoring your server.

Configuring access log filters

Access log entries can be filtered based on any of the following attributes:

To specify your filters, in the Configuration and Administration forms, select Server Configuration -> Logging -> Access Log Exclusions. Specify only those exclusions that you want. You do not need to use all the categories.

Click Submit.

Related configuration file directives

To set access log filters by using the proxy configuration file, see the reference sections in Appendix B. Configuration file directives for the following directives:

Default log settings

Maintaining and archiving logs

Caching Proxy uses a plug-in to manage logs. For further information, see the reference page in Appendix B. Configuration file directives for the configuration file directive Midnight -- Specify the API plugin used to archive logs.

You can specify how to archive and remove daily logs. The basic options are:

By default, the current and previous days' logs are never deleted by any maintenance agent. All of the current day's logs and the previous day's cache access log are never compressed by any maintenance agent.

To configure log maintenance, in the Configuration and Administration forms, select Server Configuration -> Logging -> Log Archiving. In this form, use the drop-down box to specify the maintenance method.

Related configuration file directives

To configure log archiving using the proxy configuration file, see the reference pages in Appendix B. Configuration file directives for the following directives:

Log file scenario

The following example shows how you can customize logging to meet your needs. Suppose you have just purchased and installed Caching Proxy. You want to set up your server to log access and error information with the following requirements:

To configure Caching Proxy to keep logs according to these criteria, in the Configuration and Administration forms, select Server Configuration -> Logging.

  1. Optionally, select the Log Files form to specify paths for the access log files. (Default paths are provided.)
  2. Use the Log Archiving form to specify how to archive the files:
  3. Use the Access Log Exclusions form to filter log entries as follows:

Following these directions produces the following lines in the proxy configuration file:

LogArchive purge 
PurgeAge 30 
PurgeSize 25 
AccessLogExcludeURL *.gif 
NoLog 130.128.*.* 
AccessLogExcludeReturnCode 300