<<Back

LOG FILE PATH NAMES AND CACHE DIRECTORIES

Tag Namecache_dir
Usage

cache_dir Type Maxobjsize Directory-Name Mbytes Level-1 Level2 [..]
DISKD :
cache_dir diskd Maxobjsize Directory-Name MB L1 L2 Q1 Q2

Description

Type specifies the kind of storage system to use. Most everyone will want to use "ufs" as the type. If you are using Async I/O (--enable async-io) on Linux or Solaris, then you may want to try "aufs" as the type. Async IO support may be buggy, however, so beware.

Maxobjsize refers to the max object size this storedir supports. It is used to initially choose the storedir to dump the object. -1 means 'any size'.

'Directory' is a top-level directory where cache swap files will be stored. If you want to use an entire disk for caching, then this can be the mount-point directory. The directory must exist and be writable by the Squid process. Squid will NOT create any directory.

'Mbytes' is the amount of disk space (MB) to use under this directory.

'Level-1' is the number of first-level subdirectories, which will be created under the 'Directory'.

'Level-2' is the number of second-level subdirectories, which will be created under each first-level directory. To create swap directory use /usr/local/squid/bin/squid –z option.

For the diskd type, Q1 specifies the number of unacknowledged I/O requests when Squid stops opening new files. If this many messages are in the queues, Squid won't open new files. Q2 specifies the number of unacknowledged messages when Squid starts blocking. If this many messages are in the queues, Squid blocks until it receives some replies.

Defaultcache_dir ufs /usr/local/squid/cache 100 16 256

Example
cache_dir ufs /cache1 5000 16 256
cache_dir ufs /cache2 7000 16 256

Note
Can specify multiple cache_dir lines to spread the cache among different disk partitions. Click Here to find more informations on file systems and cache_dir.

 

Tag Namecache_access_log
Usagecache_access_log Directory-path/filename

Description
This tag is used to specify the path of the access.log file, which logs the client request activity. It contains an entry for every HTTP and ICP queries received. Log Details can be customized using log_mime_hdrs, log_fqdn, client_netmask and emulate_httpd_log.

See for Detailed information about this log file. See also log_icp_queries.

Defaultcache_access_log /usr/local/squid/logs/access.log

Example
cache_access_log /var/log/squid_access.log

Caution
It is safe to set log_mime_hdrs off.

 

Tag Namecache_log
Usagecache_log Directory-path/filename

Description
This tag is used to set the path of the Cache logging file. This is where general information about the cache's behaviour goes. Amount of data logged to this file can be increased with the debug_options tag below.

Defaultcache_log /usr/local/squid/logs/cache.log

Example
cache_log /var/log/squid_cache.log

Caution
Do not change the default value of debug_options unless otherwise needed. Because if debug_options value is high, then logging information goes high. This leads to undesirable growth in log file.

 

Tag Namecache_store_log
Usagecache_store_log Directory-path/filename

Description
This tag is used to specify the location of the store.log, the file that logs the activities of the storage manager. The file shows which objects are ejected from the cache, and which objects are saved and for how long.

Defaultcache_store_log /usr/local/squid/logs/store.log

Example
cache_store_log /var/log/squid_store.log

Caution
There are no real utilities to analyze this data. So it is recommended to disable this tag

Note
To disable, enter "none" instead of the filename.

 

Tag Namecache_swap_log
Usagecache_ swap _log Directory-path/filename

Description
This tag specifies the location for the cache "swap.log." This log file holds the metadata of objects saved on disk. It is used to rebuild the cache during startup. Normally this file resides in the first 'cache_dir' directory, but you may specify an alternate pathname here. Note, you must give a full filename, not just a directory. Since this is the index for the whole object list you CANNOT periodically rotate it.

If you have more than one 'cache_dir', these swap logs will have names such as:

  • cache_swap_log.00
  • cache_swap_log.01
  • cache_swap_log.02

The numbered extension (which is added automatically) corresponds to the order of the 'cache_dir' lines in this configuration file.

Defaultcache_ swap _log /usr/local/squid/logs/ swap.log

Example
cache_ swap _log /var/log/squid_ swap.log

Caution
If you change the order of the 'cache_dir' lines in this file, then these log files will NOT correspond to the correct 'cache_dir' entry (unless you manually rename them). We recommend that you do NOT use this option. It is better to keep these log files in each 'cache_dir' directory.

 

Tag Nameemulate_httpd_log
Usageemulate_httpd_log on|off

Description
The Cache can emulate the log file format, which many 'httpd' programs use. To disable/enable this emulation, set emulate_httpd_log to 'off' or 'on'.

Defaultemulate_httpd_log off
(By Default Squid Native Log format is used. Since it includes useful information that Squid-specific log analyzers use).

Example
emulate_httpd_log on

Caution
Before setting this to ON, make sure you have httpd_log file analyzers which will analyze log files and give us useful information.

 

Tag Namelog_ip_on_direct
Usagelog_ip_on_direct on|off

Description
This tag is used to enable/disable logging of the destination IP address in the hierarchy log tag when the cache directs the request to the origin server.

Defaultlog_ip_on_direct on

Example
log_ip_on_direct off

Note
Earlier Squid versions logged the hostname here. If you prefer the old way, set this to off.

 

Tag Namemime_table
Usagemime_table Directory-Path/filename

Description
This tag is used to set the pathname to Squid's MIME table. This file contains Squid's supported mime types.

Defaultmime_table /usr/local/squid/etc/mime.conf

Caution
Shouldn't need to change this, but the default file contains examples and formatting information if done.

 

Tag Namelog_mime_hdrs
Usagelog_mime_hdrs on|off

Description
The Cache can record both the request and the response MIME headers for each HTTP transaction. The headers are encoded safely and will appear as two bracketed fields at the end of the access log (for either the native or httpd-emulated log formats). To enable this logging, set log_mime_hdrs to 'on'.

Defaultlog_mime_hdrs off

 

Tag Nameuseragent_log
Usageuseragent_log Directory-path/filename

Description
If configured with the "--enable-useragent_log" configure option, Squid will write the User-Agent field from HTTP requests to the filename specified here.

Defaultuseragent_log none (By default useragent_log is disabled.)

Example
useragent_log /var/log/useragent.log

 

Tag Namereferer_log
Usagereferer_log Directory-path/filename

Description
If configured with the "--enable-referer_log" configure option, Squid will write the Referer field from HTTP requests to the filename specified here.

Defaultreferer_log none (By default referer_log is disabled.)

Example
referer_log /var/log/referer.log

 

Tag Namepid_filename
Usagepid_filename Directory-path/filename

Description
This tag specifies the location of the file in which Squid writes its process-ids.

Defaultpid_filename /usr/local/squid/logs/squid.pid

Example
pid_filename /var/lock/squid.pid

Caution
To disable, enter "none".

 

Tag Namedebug_options
Usagedebug_options section, level

Description
Logging options are set as section, level, where each source file is assigned a unique section. Lower levels result in less output. The magic word "ALL" sets debugging levels for all sections. We recommend normally running with "ALL, 1".

Defaultdebug_options ALL, 1

Example
debug_options ALL, 9

Caution
Full debugging (level 9) can result in a very large log file, so be careful. Normally, running with "ALL, 1" is recommended.

 

Tag Namelog_fqdn
Usagelog_fqdn on|off

Description
This tag can be set to ON, if you wish to log fully qualified domain names in the access.log.

Defaultlog_fqdn off

Example
log_fqdn on

Caution
To do this, Squid does a DNS lookup of all IP's connecting to it. This can (in some situations) increase latency, which makes your cache seem slower for interactive browsing.

 

Tag Nameclient_netmask
Usageclient_netmask NETMASK

Description
A netmask for client addresses in log files and cachemgr output. Change this to protect the privacy of your cache clients. A netmaskof 255.255.255.0 will log all IP's in that range with the last digit set to '0'.

Defaultclient_netmask 255.255.255.255

Example
client_netmask 255.255.255.0

Caution
When you enable this tag, then the client's visit pages cannot be identified.

 

<<Back
 

All rights reserved.
All trademarks used in this document are owned by their respective companies. This document makes no ownership claim of any trademark(s). If you wish to have your trademark removed from this document, please contact the copyright holder. No disrespect is meant by any use of other companies’ trademarks in this document.
Note: The pages on this website cannot be duplicated on to another site. Copying and usage of the contents for personal and corporate purposes is acceptable. In near future, it will be released under the GNU Free Documentation License.
© ViSolve.com 2002 
Created By:squid@visolve.comDate: May 15,2002
Revision No:0.0 
Modified ByDate