Re: [PATCH] Polish log formats

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Sun, 28 Nov 2010 09:34:49 -0700

On 11/28/2010 05:08 AM, Amos Jeffries wrote:
> 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?

FWIW, I did not notice any problems with the patch during a quick check.

While I do not know anybody using the obsoleted or removed features, it
may be a good idea to warn about those logging changes on squid-users
and see if there are any reasonable objections.

Thank you,

Alex.
Received on Sun Nov 28 2010 - 16:35:06 MST

This archive was generated by hypermail 2.2.0 : Mon Nov 29 2010 - 12:00:05 MST