Squid_ The Definitive Guide - Duane Wessels [184]
Syntax
log_mime_hdrs on|off
Default
log_mime_hdrs off
Example
log_mime_hdrs on
Related
cache_access_log
Name
useragent_log
Synopsis
This directive causes Squid to create a log file of User-Agent strings. The file contains three fields: client identifier, timestamp, and user-agent string. The client identifier is an IP address, unless you enable the log_fqdn directive, in which case it is a hostname if one is available. Squid writes an entry for every HTTP request that has a User-Agent header. Unlike access.log, entries are written to this file when the request is received.
Syntax
useragent_log pathname
Default
No default
Example
useragent_log /usr/local/squid/var/logs/useragent.log
Related
log_fqdn, cache_access_log, referer_log
Name
referer_log
Synopsis
This directive causes Squid to create a log file of Referer values from client requests. The file contains four fields: time, client identifier, Referer value, and the URI request. For example, when a client requests the image foo.png embedded in an index.html, the referer log contains:
1068047502.377 192.168.1.2 /index.html /foo.png
Squid writes an entry for every HTTP request that has a Referer header. Unlike access.log, entries are written to this file when the request is received.
Syntax
referer_log pathname
Default
No default
Example
referer_log /usr/local/squid/var/logs/referer.log
Related
log_fqdn, cache_access_log, useragent_log
Name
pid_filename
Synopsis
This is the file in which Squid writes its process ID (PID) number. Squid uses the PID file in a couple of ways. First, it looks for and reads this file when starting. If the file exists and contains a valid PID, Squid reports it is already running under that PID so that you don't accidentally start Squid twice. The PID file is also read when you use one of the -k commands such as squid -k rotate.
You probably don't need to worry about this directive unless you actually do want to run two (or more) Squid processes on the same machine. Each instance of Squid requires a unique PID filename.
Syntax
pid_filename pathname
Default
pid_filename $prefix/var/logs/squid.pid
Example
pid_filename /var/run/squid.pid
Name
debug_options
Synopsis
This directive controls the amount of debugging information written to cache.log. Each source code module has a section number. Individual debugging statements in the code have a level. Higher debugging levels correspond to more verbose debugging. For a list of section numbers, refer to Table 16-1 or the doc/debug-sections.txt file in the source distribution.
Syntax
debug_options section,level ...
Default
debug_options ALL,1
Example
debug_options ALL,1 42,5
Related
cache_log
Name
log_fqdn
Synopsis
This directive controls whether or not Squid places client IP addresses or hostnames in the log files. By default Squid writes the IP address. If you enable this feature, Squid queries the DNS for client hostnames or fully qualified domain names (FQDN). These address-to-name lookups sometimes take a long time. Squid never postpones logging to wait for an answer. If the FQDN isn't available when Squid is ready to write the log entry, it uses the IP address.
Syntax
log_fqdn on|off
Default
log_fqdn off
Example
log_fqdn on
Related
cache_access_log, useragent_log, referer_log, fqdncache_size, client_netmask
Name
client_netmask
Synopsis
This directive is available to provide privacy for users. When Squid writes access.log and other log files, it applies this mask to the client's IP address. For example, if you set the netmask to 255.255.255.0, Squid logs a request from 1.2.3.0 instead of 1.2.3.4. Thus, if someone manages to read the log file, they know only approximately, not exactly, which host (or user) made each request.
If you use log_fqdn, Squid applies the client_netmask before issuing the DNS lookup. For example, Squid will try to find a hostname record for 1.2.3.0 instead of 1.2.3.4.