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:
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.
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 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.
There are several reasons to restrict what is logged:
The log files of a busy server can become large enough to fill the server's disk space. By default, all access requests are logged, which means that log entries are made not only for an HTML page but for each image that the page contains. Including only meaningful access requests can significantly reduce the number of entries in the log. For example, you might want to configure your access logs so that they include log entries for HTML page access requests, but not for requests for GIF images.
For example, if you are interested in who is accessing your server from outside your company, you can filter out access requests that originate from IP addresses within your company. If you are interested in finding out the size of the audience for a particular Web site, you can create an access log that shows only the access requests for that URL.
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.
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:
All logs are enabled in the Caching Proxy default configuration. They are stored in the logs/ subdirectory of the installation directory. The default paths are the following:
Each log file name is a combination of the base name and a date suffix in the form .Mmmddyyyy, for example, proxy.Feb292000.
Logs are stored in the common file format by default. A combined log format is also available and can be set by adding the following line to the proxy configuration file (ibmproxy.conf).
LogFileFormat combined
The combined log format is similar to the common format but has added fields that show the referrer, the user agent, and cookie information. Local time format is the default time format.
By default, all access requests are recorded in the appropriate access log, and no access information is recorded in the system log. Error log information is written to the error log only, and event log information is written to the event log only.
In the default configuration, logs are not archived or deleted.
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:
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.
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