Squid Web Cache wiki

Squid Web Cache documentation

🔗 Feature: Log Modules for Squid

🔗 Plug-in Modules

Logging modules are API built into Squid which pass logging information out to helpers in several different formats.

General access_log format:

access_log module:parameters [logformat] [acls]

🔗 Module: Standard I/O

This is a module uses the traditional I/O method of Squid writing its logs directly to the file system.

Configuration module:parameters to be used by access_log:

stdio:/var/log/squid/access.log

:information_source: Used for backwards compatibility with old squid.conf. It is recommended that you upgrade to the daemon module with the basic file helper for better performance.

🔗 Module: Daemon

This is a module runs a helper daemon to offload the log storage processing from Squid.

The helper daemon program is configured with the logfile_daemon directive.

logfile_daemon /path/to/helper.binary

Configuration module:parameters to be used by access_log:

daemon:/var/log/squid/access.log

🔗 Daemon Helpers Available

🔗 Daemon Message Protocol

Squid sends a number of commands to the log daemon. These are sent in the first byte of each input line:

| ------------ | ------------------------------------------ |
| L\<data\>\\n | logfile data                               |
| R\\n         | rotate file                                |
| T\\n         | truncate file                              |
| O\\n         | re-open file                               |
| F\\n         | flush file                                 |
| r\<n\>\\n    | set rotate count to \<n\>                  |
| b\<n\>\\n    | 1 = buffer output, 0 = don't buffer output |

No response is expected. Any response that may be desired should occur on stderr to be viewed through cache.log.

🔗 Module: System Log

This is a module using the syslog() API to send log data to any system logging daemons which accept records in that binary format.

Configuration module:parameters to be used by access_log:

syslog:facility.priority

facility and priority fields are intentionally formatted the same as syslog.conf entries. See your syslog configuration documentation for possible values.

:information_source: syslog uses UDP which may drop packets when the network is under load or congested.

🔗 Module: UDP Receiver

This is a module using UDP protocol to send log lines to an external daemon or central logging server.

Configuration module:parameters to be used by access_log:

udp://host:port

:information_source: being UDP this module may drop packets when the network is under load or congested.

🔗 Module: TCP Receiver

This is a module using TCP protocol to send log lines to an external daemon or central logging server.

Configuration module:parameters to be used by access_log:

tcp://host:port

:information_source: Syslog-ng can receive these logs directly.

Navigation: Site Search, Site Pages, Categories, 🔼 go up