Skip to content

Instantly share code, notes, and snippets.

@jfeilbach
Last active November 14, 2019 17:08
Show Gist options
  • Save jfeilbach/bce617c25e44087b96a0b3b0e3cb90c6 to your computer and use it in GitHub Desktop.
Save jfeilbach/bce617c25e44087b96a0b3b0e3cb90c6 to your computer and use it in GitHub Desktop.
improve squid logging
logformat squid %tl %6tr %>a %Ss/%03Hs %<st %rm %ru %un %Sh/%<A %mt
```
Time related format codes:
ts Seconds since epoch
tu subsecond time (milliseconds)
tl Local time. Optional strftime format argument
default %d/%b/%Y:%H:%M:%S %z
tg GMT time. Optional strftime format argument
default %d/%b/%Y:%H:%M:%S %z
tr Response time (milliseconds)
dt Total time spent making DNS lookups (milliseconds)
tS Approximate master transaction start time in
<full seconds since epoch>.<fractional seconds> format.
Currently, Squid considers the master transaction
started when a complete HTTP request header initiating
the transaction is received from the client. This is
the same value that Squid uses to calculate transaction
response time when logging %tr to access.log. Currently,
Squid uses millisecond resolution for %tS values,
similar to the default access.log "current time" field
(%ts.%03tu).
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment