]> git.ipfire.org Git - thirdparty/squid.git/commit - src/log/FormattedLog.cc
Make CustomLog more reusable (#824)
authorAlex Rousskov <rousskov@measurement-factory.com>
Thu, 20 May 2021 03:11:17 +0000 (03:11 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Fri, 21 May 2021 13:24:00 +0000 (13:24 +0000)
commit39d7714ae03e9d9b27dfb0ffdfb1a6a5de01ccf4
tree80a5ad79e31107e1085132cdc9681446deee1b23
parentee781581117482defc4fa56e2243642a57152b80
Make CustomLog more reusable (#824)

The future tls_key_log directive supports most access_log features but
should not inherit deprecated configuration styles, multi-directive
support complications, and legacy top-level configuration parsing code.
The shared/reusable bits were extracted from CustomLog and cache_cf.cc
functions into the new FormattedLog class. Some of them were polished.

All existing access_log/etc. directives continue to use CustomLog, so
nothing in the code justifies FormattedLog existence right now.

Fixed at least these old bugs:

* access_log config dumps were missing the destination parameter
* "access_log none" config dump included a bogus "logformat=none" option
* "access_log buffer-size=..." config dump were missing size units
* built-in logformat re-definition check missed the "icap_squid" format
* "access_log rotate=N" accepted (but then ignored) negative N values
* "access_log rotate=N" was stored as short but dumped as full integer

Admin-visible changes:

* access_log key=value strings are now case sensitive. This change
  improves consistency with squid.conf directives that are all case
  sensitive and most other directive options. The logformat name was
  already case sensitive. I see no good reason to keep this undocumented
  exception.
14 files changed:
src/ConfigParser.cc
src/ConfigParser.h
src/cache_cf.cc
src/log/Config.cc
src/log/Config.h
src/log/CustomLog.cc [deleted file]
src/log/CustomLog.h
src/log/FormattedLog.cc [new file with mode: 0644]
src/log/FormattedLog.h [new file with mode: 0644]
src/log/Makefile.am
src/log/access_log.cc
src/log/forward.h
src/tests/stub_cache_cf.cc
src/tests/stub_liblog.cc