Time for action – using access_log to control logging of requests

As we have seen in a previous section of this chapter, the syntax of the access_log directive is as follows:

access_log <module>:<path> [<logformat name> [acl acl ...]]

So, here we have an option to specify ACL lists which we can use to control where the different requests will be logged, if at all. Let's consider a scenario where we don't want to log requests to Yahoo! servers and we do want to log requests to Google and Facebook servers to separate files, and all other requests go to the access log. This scenario can be realized with the following configuration:

acl yahoo dstdomain .yahoo.com acl google dstdomain .google.com acl facebook dstdomain .facebook.com log_access deny yahoo ...

Get Squid Proxy Server 3.1 Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.