February 2011
Intermediate to advanced
332 pages
9h 3m
English
Squid has a lot of information about every client request and reply, however it writes only the requested information to the log file, which we can customize by defining several log formats.
Now, let's define a log format in which the time will appear in a human-readable format and use it with access_log:
logformat minimal %tl %>a %Ss/%03>Hs %rm %ru access_log daemon:/opt/squid/var/logs/access.log minimal
So, we have constructed a new log format that will log the information we are most interested in. Let's see a few log messages in the preceding format:
11/Sep/2010:23:52:33 +0530 127.0.0.1 TCP_MISS/200 GET http://en.wikipedia.org/wiki/Main_Page 11/Sep/2010:23:52:34 +0530 127.0.0.1 ...
Read now
Unlock full access