[PATCH] Polish log formats

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Mon, 29 Nov 2010 01:08:38 +1300

This polishes up the various log line formatting code sitting around
Squid in accordance with the SourceLayout plan.

Adds:

* namespace Log::Format for log display functionality. Each line
formater is a global function inside here. The log format enum is also
in here along with the display encoding 'gadget' functions.

* namespace Time in SquidTime.h for the related time string display
functions. Unified the various log pretty-print httpd-style time
functions into Time::FormatHttpd(time_t).
  ** care has been taken to preserve the local-static optimization found
in accessLogTime() to prevent wasted cycles re-printing the same time
value more than once per second.

NP: the similar but timezone-missing format is now Time::FormatStrf()
with the same optimization applied to speed up its callers.

* namespace Math:: to avoid symbol clash with global function Log() and
namespace Log.

* support for the Apache "combined" log format. Was documented earlier
as being available but not actually present.

Obsoletes:

* forward_log directive and associated experimental code. If needed we
can easily add another special format to dump the details.
  FWIW they are all available in the squid format anyway (timestamp,
squid status, source peer). The documented action of dumping every
forwarding attempt was not working.

* referer_log and useragent_log directives and matching ./configure options.
  ** shuffled into access_log formats "referrer" and "useragent" for
more flexibility with less directives.

* emulate_httpd_log replaced with Apache "common" format.

* the "auto" pseudo-format becomes obsolete with emulat_httpd_log.
default is now "squid" format in all situations.

Code Shuffles:

* moved the logformat directive parsing into LogConfig object methods.

* shuffled the logformat parsing and token code into src/log/Tokens.h|cc
  ** this is purely to break it out of access_log.cc. namespace and
scoping needs some work.

TODO:

There are two logging types which remain in the old code.

  - the multicast MISS streaming. I'm not sure if that should even be a
log or pushed out into client side somewhere.

  - the headers.log code. It produces multi-line log entries which could
require some slightly expensive processing to re-format the bytes for
output via the logging modules.
  Do we need it or still have a use for this log?

Amos

-- 
Please be using
   Current Stable Squid 2.7.STABLE9 or 3.1.9
   Beta testers wanted for 3.2.0.3

Received on Sun Nov 28 2010 - 12:08:54 MST

This archive was generated by hypermail 2.2.0 : Sun Nov 28 2010 - 12:00:05 MST