Squid 2.4 Stable1
Configuration Manual
 

   
Previous
Table of Contents
Next

LOG FILE PATH NAMES AND CACHE DIRECTORIES


Tag Name

cache_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 "asyncufs" 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 willbe created under each first-level directory. To create swap directoryuse /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

Default

cache_dir ufs –1 /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 thecache among different disk partitions.Click Here to find more informations on filesystems and cache_dir.      

 

Tag Name

cache_access_log

Usage

cache_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.

Default

cache_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 Name

cache_log

Usage

cache_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 behavior goes.Amount of data logged to this file can be increased with the debug_options tag below

Default

cache_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 logfile.
cache.log can be disabled using /dev/null instead of givingthe file pathname. But in this case, there is a need to disable log rotate also. This must be done to avoid OS crash. Generally when try to rotate the file /dev/null which was given in cache_log, then OS refuse to work which leads to OS crash.


Tag Name

cache_store_log

Usage

cache_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 fileshows which objects are ejected from the cache, and which objects aresaved and for how long

Default

cache_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 Name

cache_swap_log

Usage

cache_ 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 isused to rebuild the cache during startup. Normally this file residesin 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 havenames 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.


Default

cache_ 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 Name

emulate_httpd_log

Usage

emulate_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'.

Default

emulate_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 on make sure you have httpd_log file analyzerswhich will analyze log files and give us useful information


Tag Name

log_ip_on_direct

Usage

log_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.

Default

log_ip_on_direct on

Example

log_ip_on_direct off

Note

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


Tag Name

mime_table

Usage

mime_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

Default

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

Example

-

Caution

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


Tag Name

log_mime_hdrs

Usage

log_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'.

Default

log_mime_hdrs off

Example

-

Caution

-


Tag Name

useragent_log

Usage

useragent_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.

Default

useragent_log none (By default useragent_log is disabled.)

Example

useragent_log /var/log/useragent.log

Caution

-

 

Tag Name

referer_log


Usage

referer_log Directory-path/filename

Description

If configured with the "--enable-referer_log" configureoption, Squid will write the Referer field from HTTP requests to thefilename specified here

Default

referer_log none (By default referer_log is disabled.)

Example

referer_log /var/log/referer.log

Caution

-


Tag Name

pid_filename

Usage

pid_filename Directory-path/filename

Description

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

Default

pid_filename /usr/local/squid/logs/squid.pid

Example

pid_filename /var/lock/squid.pid

Caution

To disable, enter "none".


Tag Name

debug_options

Usage

debug_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".

Default

debug_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 Name

log_fqdn

Usage

log_fqdn on|off

Description

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

Default

log_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 Name

client_netmask

Usage

client_netmask NETMASK

Description

A netmask for client addresses in logfiles and cachemgroutput. Change this to protect the privacy of your cache clients. Anetmaskof 255.255.255.0 will log all IP's in that range with the lastdigitset to '0'.

Default

client_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.