Time for action – learning log format and format codes

Log format can be defined using the logformat directive available in the Squid configuration file. The syntax for defining logformat is as follows:

logformat <name> <format specification>

Format specification is a series of format code, as described in the following information:

Format code

Format description

%

A literal % character.

sn

Unique sequence number per log line entry.

err_code

The ID of an error response served by Squid or a similar internal error identifier.

err_detail

Additional err_code dependent error information.

>a

Client's source IP address.

>A

Client's FQDN (Fully Qualified Domain Name).

>p

Client's source port.

<A

Server's IP address or ...

Get Squid Proxy Server 3.1 Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.