]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/log/FormatSquidUseragent.cc
9767376d8d201036e3222979f7842341e40b4094
2 * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
9 /* DEBUG: section 46 Access Log - Squid useragent format */
12 #include "AccessLogEntry.h"
13 #include "HttpRequest.h"
15 #include "log/Formats.h"
16 #include "SquidTime.h"
19 Log::Format::SquidUserAgent(const AccessLogEntry::Pointer
&al
, Logfile
* logfile
)
21 const char *agent
= NULL
;
24 agent
= al
->request
->header
.getStr(Http::HdrType::USER_AGENT
);
26 if (!agent
|| *agent
== '\0')
29 char clientip
[MAX_IPSTRLEN
];
30 al
->getLogClientIp(clientip
, MAX_IPSTRLEN
);
32 logfilePrintf(logfile
, "%s [%s] \"%s\"\n",
34 Time::FormatHttpd(squid_curtime
),