Selective logging of requests
Sometimes we may not want to log requests from certain clients. This could be because of several reasons. One reason may be that a team is working on a highly secret project and we don't want to leave any impressions of their browsing patterns anywhere.
Logging of requests can be controlled using two directives, namely, log_access
and access_log
. These directives may look confusing when used in the same sentence but we can interpret the meaning by the sequence in which the individual words appear in the directive name. The directive access_log
is used for controlling the format of the log messages and the location where the messages will be logged. While the directive log_access
is used to control whether a particular request should be logged or not.
We have already learned about the log_access
directive in the Log Access section in Chapter 2, Configuring Squid. Now, we will learn about using the access_log
directive to cache selective requests.