[squid-users] Logging ICAP headers in access log

Alex Rousskov rousskov at measurement-factory.com
Mon Apr 15 17:35:16 UTC 2019


On 4/12/19 3:21 PM, johnr wrote:

> I am attempting to log ICAP headers in the access log. Specifically, I
> modify my logformat directive to include something like
> {x-icap-info}icap::>h for a header x-icap-info that is available in the icap
> request headers. 

I have not tested this, but I doubt it is supported. Squid does not
remember individual ICAP transactions and probably does not remember the
last ICAP request headers either. Squid only remembers the last ICAP
response header (%adapt::<last_h), but that is not what you want.


> From the logformat documentation
> (http://www.squid-cache.org/Doc/config/logformat/) it says that log codes
> mentioned in icap_log (http://www.squid-cache.org/Doc/config/icap_log/) are
> available if icap is enabled. 

If I am right regarding that lack of support, then my original wording
in logformat documentation (commit 3ff6559) was poor/misleading: What I
was probably trying to say is that %icap::x codes documented in the
icap_log directive become available *for use with icap_log* when ICAP
support is enabled.

If you want to log ICAP request headers, consider using icap_log or
enhancing Squid to remember the last ICAP request header (like Squid
already remembers the last ICAP response header).


HTH,

Alex.


More information about the squid-users mailing list