This data is actually meaningful for the analysis of client behaviour.
squid-dev have agreed that it is worth removing the old log behaviour of
omitting these entries.
void
Log::Format::SquidReferer(AccessLogEntry *al, Logfile *logfile)
{
- // do not log unless there is something to be displayed
- if (!al || !al->request)
- return;
+ const char *referer = NULL;
+ if (al && al->request)
+ referer = al->request->header.getStr(HDR_REFERER);
- const char *referer = al->request->header.getStr(HDR_REFERER);
-
- // do not log unless there is something to be displayed
if (!referer || *referer == '\0')
- return;
+ referer = "-";
char clientip[MAX_IPSTRLEN];
al->getLogClientIp(clientip, MAX_IPSTRLEN);
void
Log::Format::SquidUserAgent(AccessLogEntry * al, Logfile * logfile)
{
- // do not log unless there is something to be displayed.
- if (!al || !al->request)
- return;
+ const char *agent = NULL;
- const char *agent = al->request->header.getStr(HDR_USER_AGENT);
+ if (al && al->request)
+ agent = al->request->header.getStr(HDR_USER_AGENT);
- // do not log unless there is something to be displayed.
if (!agent || *agent == '\0')
- return;
+ agent = "-";
char clientip[MAX_IPSTRLEN];
al->getLogClientIp(clientip, MAX_IPSTRLEN);