------------------------------------------------------------ revno: 13208 revision-id: squid3@treenet.co.nz-20140105025631-w7bw7ct9urxjq4lv parent: squid3@treenet.co.nz-20140106011000-9474hs6pind933f6 committer: Amos Jeffries branch nick: trunk timestamp: Sat 2014-01-04 18:56:31 -0800 message: Add logformat code %>rd to log client URL domain name Logging the Host header or the full URL have been the only ways to log the domain name requested by the client. However full URL may contain far too many unwanted bytes and Host header many contain a host:port very different to the URL. This work is sponsored by Brendan Kearney ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20140105025631-w7bw7ct9urxjq4lv # target_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # testament_sha1: c5ff201c60909651a3baf498aad4c815f7f43e64 # timestamp: 2014-01-06 03:55:26 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # base_revision_id: squid3@treenet.co.nz-20140106011000-\ # 9474hs6pind933f6 # # Begin patch === modified file 'src/cf.data.pre' --- src/cf.data.pre 2014-01-01 19:20:49 +0000 +++ src/cf.data.pre 2014-01-05 02:56:31 +0000 @@ -3761,6 +3761,7 @@ [http::]ru Request URL from client (historic, filtered for logging) [http::]>ru Request URL from client [http::]rd Request URL domain from client [http::]rp Request URL-Path excluding hostname [http::]>rp Request URL-Path excluding hostname from client [http::]request) { + out = al->request->GetHost(); + quote = 1; + } + break; + case LFT_REQUEST_URLPATH_OLD_31: case LFT_CLIENT_REQ_URLPATH: if (al->request) { === modified file 'src/format/Token.cc' --- src/format/Token.cc 2013-12-06 14:59:47 +0000 +++ src/format/Token.cc 2014-01-05 02:56:31 +0000 @@ -81,6 +81,7 @@ {">rm", LFT_CLIENT_REQ_METHOD}, {">ru", LFT_CLIENT_REQ_URI}, + {">rd", LFT_CLIENT_REQ_URLDOMAIN}, {">rp", LFT_CLIENT_REQ_URLPATH}, /*{">rq", LFT_CLIENT_REQ_QUERY},*/ {">rv", LFT_CLIENT_REQ_VERSION},