You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by so...@apache.org on 2015/06/16 20:15:06 UTC

[1/2] trafficserver git commit: TS-1985: Removed hard-coded logging formats; now configurable in log .xml.

Repository: trafficserver
Updated Branches:
  refs/heads/master fc8113b8c -> 9236bb738


TS-1985: Removed hard-coded logging formats; now configurable in log .xml.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/5c2b032f
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/5c2b032f
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/5c2b032f

Branch: refs/heads/master
Commit: 5c2b032fb9f8f05ae7be1794a3103140ffe7d07e
Parents: fc8113b
Author: Crystal Qian <cr...@cable.comcast.net>
Authored: Fri Jun 12 16:53:35 2015 -0600
Committer: Phil Sorber <so...@apache.org>
Committed: Tue Jun 16 11:47:22 2015 -0600

----------------------------------------------------------------------
 doc/admin/working-log-files.en.rst              |  43 +--
 .../LC_MESSAGES/admin/working-log-files.en.po   |  84 ------
 .../configuration/records.config.en.rst         | 101 +------
 lib/perl/lib/Apache/TS/AdminClient.pm           |  16 --
 mgmt/RecordsConfig.cc                           |  32 ---
 proxy/config/logs_xml.config.default            |  35 +++
 proxy/config/records.config.default.in          |   2 -
 proxy/logcat.cc                                 |  10 -
 proxy/logging/LogConfig.cc                      | 271 +------------------
 proxy/logging/LogConfig.h                       |  62 ++---
 proxy/logging/LogPredefined.cc                  | 113 --------
 proxy/logging/LogPredefined.h                   |  69 -----
 proxy/logging/Makefile.am                       |   2 -
 tools/traffic_shell.pl                          |  48 ----
 14 files changed, 88 insertions(+), 800 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5c2b032f/doc/admin/working-log-files.en.rst
----------------------------------------------------------------------
diff --git a/doc/admin/working-log-files.en.rst b/doc/admin/working-log-files.en.rst
index 8248a55..0ac2d1d 100644
--- a/doc/admin/working-log-files.en.rst
+++ b/doc/admin/working-log-files.en.rst
@@ -222,37 +222,18 @@ analyzed with a wide variety of off-the-shelf log-analysis packages. You
 should use one of the standard event log formats unless you need
 information that these formats do not provide. Refer to `Using the Custom Format`_.
 
-Set standard log file format options by following the steps below:
-
-#. In the :file:`records.config` file, edit the following variables
-
-#. Edit the following variables to use the Squid format:
-
-   -  :ts:cv:`proxy.config.log.squid_log_enabled`
-   -  :ts:cv:`proxy.config.log.squid_log_is_ascii`
-   -  :ts:cv:`proxy.config.log.squid_log_name`
-   -  :ts:cv:`proxy.config.log.squid_log_header`
-
-#. To use the Netscape Common format, edit the following variables:
-
-   -  :ts:cv:`proxy.config.log.common_log_enabled`
-   -  :ts:cv:`proxy.config.log.common_log_is_ascii`
-   -  :ts:cv:`proxy.config.log.common_log_name`
-   -  :ts:cv:`proxy.config.log.common_log_header`
-
-#. To use the Netscape Extended format, edit the following variables:
-
-   -  :ts:cv:`proxy.config.log.extended_log_enabled`
-   -  :ts:cv:`proxy.config.log.extended_log_is_ascii`
-   -  :ts:cv:`proxy.config.log.extended_log_name`
-   -  :ts:cv:`proxy.config.log.extended_log_header`
-
-#. To use the Netscape Extended-2 format, edit the following variables:
-
-   -  :ts:cv:`proxy.config.log.extended2_log_enabled`
-   -  :ts:cv:`proxy.config.log.extended2_log_is_ascii`
-   -  :ts:cv:`proxy.config.log.extended2_log_name`
-   -  :ts:cv:`proxy.config.log.extended2_log_header`
+#. Log formats are now configured and enabled via :file:`logs_xml.config`. 
+   Here are four example log formats, which match with the previous configurations (set formerly in :file:`records.config`). 
+   -  :ts:cv: [format]_log_enabled
+   -  :ts:cv: [format]_is_ascii
+   -  :ts:cv: [format]_name
+   -  :ts:cv: [format]_header
+
+The [format] specified can be squid (Squid), common (Netscape Common),
+extended (Netscape Extended), or extended2 (Netscape Extended 2).
+
+Note that the squid log object is created by default, and will be used if logging is enabled. 
+Users can use any number of log formats and create any number of log objects via the XML config.
 
 #. Run the command :option:`traffic_line -x` to apply the configuration
    changes.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5c2b032f/doc/locale/ja/LC_MESSAGES/admin/working-log-files.en.po
----------------------------------------------------------------------
diff --git a/doc/locale/ja/LC_MESSAGES/admin/working-log-files.en.po b/doc/locale/ja/LC_MESSAGES/admin/working-log-files.en.po
index 88662ba..91f3a3c 100644
--- a/doc/locale/ja/LC_MESSAGES/admin/working-log-files.en.po
+++ b/doc/locale/ja/LC_MESSAGES/admin/working-log-files.en.po
@@ -384,90 +384,6 @@ msgid ""
 "formats do not provide. Refer to `Using the Custom Format`_."
 msgstr ""
 
-#: ../../admin/working-log-files.en.rst:236
-msgid "Set standard log file format options by following the steps below:"
-msgstr ""
-
-#: ../../admin/working-log-files.en.rst:239
-msgid "Edit the following variables to use the Squid format:"
-msgstr ""
-
-#: ../../admin/working-log-files.en.rst:241
-msgid ":ts:cv:`proxy.config.log.squid_log_enabled`"
-msgstr ""
-
-#: ../../admin/working-log-files.en.rst:242
-msgid ":ts:cv:`proxy.config.log.squid_log_is_ascii`"
-msgstr ""
-
-#: ../../admin/working-log-files.en.rst:243
-msgid ":ts:cv:`proxy.config.log.squid_log_name`"
-msgstr ""
-
-#: ../../admin/working-log-files.en.rst:244
-msgid ":ts:cv:`proxy.config.log.squid_log_header`"
-msgstr ""
-
-#: ../../admin/working-log-files.en.rst:246
-msgid "To use the Netscape Common format, edit the following variables:"
-msgstr ""
-
-#: ../../admin/working-log-files.en.rst:248
-msgid ":ts:cv:`proxy.config.log.common_log_enabled`"
-msgstr ""
-
-#: ../../admin/working-log-files.en.rst:249
-msgid ":ts:cv:`proxy.config.log.common_log_is_ascii`"
-msgstr ""
-
-#: ../../admin/working-log-files.en.rst:250
-msgid ":ts:cv:`proxy.config.log.common_log_name`"
-msgstr ""
-
-#: ../../admin/working-log-files.en.rst:251
-msgid ":ts:cv:`proxy.config.log.common_log_header`"
-msgstr ""
-
-#: ../../admin/working-log-files.en.rst:253
-msgid "To use the Netscape Extended format, edit the following variables:"
-msgstr ""
-
-#: ../../admin/working-log-files.en.rst:255
-msgid ":ts:cv:`proxy.config.log.extended_log_enabled`"
-msgstr ""
-
-#: ../../admin/working-log-files.en.rst:256
-msgid ":ts:cv:`proxy.config.log.extended_log_is_ascii`"
-msgstr ""
-
-#: ../../admin/working-log-files.en.rst:257
-msgid ":ts:cv:`proxy.config.log.extended_log_name`"
-msgstr ""
-
-#: ../../admin/working-log-files.en.rst:258
-msgid ":ts:cv:`proxy.config.log.extended_log_header`"
-msgstr ""
-
-#: ../../admin/working-log-files.en.rst:260
-msgid "To use the Netscape Extended-2 format, edit the following variables:"
-msgstr ""
-
-#: ../../admin/working-log-files.en.rst:262
-msgid ":ts:cv:`proxy.config.log.extended2_log_enabled`"
-msgstr ""
-
-#: ../../admin/working-log-files.en.rst:263
-msgid ":ts:cv:`proxy.config.log.extended2_log_is_ascii`"
-msgstr ""
-
-#: ../../admin/working-log-files.en.rst:264
-msgid ":ts:cv:`proxy.config.log.extended2_log_name`"
-msgstr ""
-
-#: ../../admin/working-log-files.en.rst:265
-msgid ":ts:cv:`proxy.config.log.extended2_log_header`"
-msgstr ""
-
 #: ../../admin/working-log-files.en.rst:275
 msgid "Using the Custom Format"
 msgstr ""

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5c2b032f/doc/reference/configuration/records.config.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/configuration/records.config.en.rst b/doc/reference/configuration/records.config.en.rst
index c027d35..d4b0fba 100644
--- a/doc/reference/configuration/records.config.en.rst
+++ b/doc/reference/configuration/records.config.en.rst
@@ -2002,97 +2002,26 @@ Logging Configuration
 
    Enables (``1``) or disables (``0``) custom logging.
 
-.. ts:cv:: CONFIG proxy.config.log.squid_log_enabled INT 1
-   :reloadable:
-
-   Enables (``1``) or disables (``0``) the `squid log file format
-   <../working-log-files/log-formats#SquidFormat>`_.
-
-.. ts:cv:: CONFIG proxy.config.log.squid_log_is_ascii INT 0
-   :reloadable:
-
-   The squid log file type:
-
-   -  ``1`` = ASCII
-   -  ``0`` = binary
-
-.. ts:cv:: CONFIG proxy.config.log.squid_log_name STRING squid
-   :reloadable:
-
-   The  :ref:`squid log <log-formats-squid-format>` filename.
-
-.. ts:cv:: CONFIG proxy.config.log.squid_log_header STRING NULL
-
-   The :ref:`squid log <log-formats-squid-format>` file header text.
-
-.. ts:cv:: CONFIG proxy.config.log.common_log_enabled INT 0
-   :reloadable:
-
-   Enables (``1``) or disables (``0``) the :ref:`Netscape common log file format <admin-log-formats-netscape-common>`.
-
-.. ts:cv:: CONFIG proxy.config.log.common_log_is_ascii INT 1
-   :reloadable:
-
-   The :ref:`Netscape common log <admin-log-formats-netscape-common>` file type:
-
-   -  ``1`` = ASCII
-   -  ``0`` = binary
-
-.. ts:cv:: CONFIG proxy.config.log.common_log_name STRING common
-   :reloadable:
-
-   The :ref:`Netscape common log <admin-log-formats-netscape-common>` filename.
-
-.. ts:cv:: CONFIG proxy.config.log.common_log_header STRING NULL
-   :reloadable:
-
-   The :ref:`Netscape common log <admin-log-formats-netscape-common>` file header text.
-
-.. ts:cv:: CONFIG proxy.config.log.extended_log_enabled INT 0
-   :reloadable:
-
-   Enables (``1``) or disables (``0``) the `Netscape extended log file format
-   <../working-log-files/log-formats#NetscapeFormats>`_.
-
-.. ts:cv:: CONFIG proxy.config.log.extended_log_is_ascii INT 0
-
-   The :ref:`Netscape extended log <admin-log-formats-netscape-extended>` file type:
-
-   -  ``1`` = ASCII
-   -  ``0`` = binary
-
-.. ts:cv:: CONFIG proxy.config.log.extended_log_name STRING extended
-
-   The :ref:`Netscape extended log <admin-log-formats-netscape-extended>` filename.
-
-.. ts:cv:: CONFIG proxy.config.log.extended_log_header STRING NULL
-   :reloadable:
-
-   The :ref:`Netscape extended log <admin-log-formats-netscape-extended>` file header text.
-
-.. ts:cv:: CONFIG proxy.config.log.extended2_log_enabled INT 0
-   :reloadable:
-
-   Enables (``1``) or disables (``0``) the `Netscape Extended-2 log file
-   format <../working-log-files/log-formats#NetscapeFormats>`_.
-
-.. ts:cv:: CONFIG proxy.config.log.extended2_log_is_ascii INT 1
-   :reloadable:
+.. note::
+    The following defaults (with the format``CONFIG proxy.config.log.[format].[default]`` have been removed from ``records.config``.
+    They can be accessed by editing :file:`logs_xml.config`.
 
-   The :ref:`Netscape Extended-2 log <admin-log-formats-netscape-extended2>` file type:
+    - ``log_enabled`` INT 1
+        Enables (``1``) or disables (``0``) the file format.
 
-   -  ``1`` = ASCII
-   -  ``0`` = binary
+    - ``log_is_ascii`` INT 0
+        The log file type:
+           - ``1`` = ASCII
+           - ``0`` = binary
 
-.. ts:cv:: CONFIG proxy.config.log.extended2_log_name STRING extended2
-   :reloadable:
+    - ``log_name`` STRING [format]
+        The filename (ex. :ref:`squid log <log-formats-squid-format>`).
 
-   The :ref:`Netscape Extended-2 log <admin-log-formats-netscape-extended2>` filename.
-
-.. ts:cv:: CONFIG proxy.config.log.extended2_log_header STRING NULL
-   :reloadable:
+    - ``log_header_ STRING NULL
+        The file header text (ex. :ref:`squid log <log-formats-squid-format>`).
 
-   The :ref:`Netscape Extended-2 log <admin-log-formats-netscape-extended2>` file header text.
+    The format can be either ``squid`` (Squid Format), ``common`` (Netscape Common),  ``extended`` (Netscape Extended), 
+    or  ``extended2`` (Netscape Extended-2).
 
 .. ts:cv:: CONFIG proxy.config.log.separate_icp_logs INT 0
    :reloadable:

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5c2b032f/lib/perl/lib/Apache/TS/AdminClient.pm
----------------------------------------------------------------------
diff --git a/lib/perl/lib/Apache/TS/AdminClient.pm b/lib/perl/lib/Apache/TS/AdminClient.pm
index 56c0c0c..4ea0966 100644
--- a/lib/perl/lib/Apache/TS/AdminClient.pm
+++ b/lib/perl/lib/Apache/TS/AdminClient.pm
@@ -581,19 +581,7 @@ The Apache Traffic Server Administration Manual will explain what these strings
  proxy.config.log.collation_port
  proxy.config.log.collation_retry_sec
  proxy.config.log.collation_secret
- proxy.config.log.common_log_enabled
- proxy.config.log.common_log_header
- proxy.config.log.common_log_is_ascii
- proxy.config.log.common_log_name
  proxy.config.log.custom_logs_enabled
- proxy.config.log.extended2_log_enabled
- proxy.config.log.extended2_log_header
- proxy.config.log.extended2_log_is_ascii
- proxy.config.log.extended2_log_name
- proxy.config.log.extended_log_enabled
- proxy.config.log.extended_log_header
- proxy.config.log.extended_log_is_ascii
- proxy.config.log.extended_log_name
  proxy.config.log.file_stat_frequency
  proxy.config.log.hostname
  proxy.config.log.hosts_config_file
@@ -615,10 +603,6 @@ The Apache Traffic Server Administration Manual will explain what these strings
  proxy.config.log.separate_host_logs
  proxy.config.log.separate_icp_logs
  proxy.config.log.space_used_frequency
- proxy.config.log.squid_log_enabled
- proxy.config.log.squid_log_header
- proxy.config.log.squid_log_is_ascii
- proxy.config.log.squid_log_name
  proxy.config.log.xml_config_file
  proxy.config.manager_binary
  proxy.config.net.connections_throttle

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5c2b032f/mgmt/RecordsConfig.cc
----------------------------------------------------------------------
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index d84d2df..e021f0d 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -1124,38 +1124,6 @@ static const RecordElement RecordsConfig[] =
   ,
   {RECT_CONFIG, "proxy.config.log.hosts_config_file", RECD_STRING, "log_hosts.config", RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL}
   ,
-  {RECT_CONFIG, "proxy.config.log.squid_log_enabled", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL}
-  ,
-  {RECT_CONFIG, "proxy.config.log.squid_log_is_ascii", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL}
-  ,
-  {RECT_CONFIG, "proxy.config.log.squid_log_name", RECD_STRING, "squid", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[^[:space:]]*$", RECA_NULL}
-  ,
-  {RECT_CONFIG, "proxy.config.log.squid_log_header", RECD_STRING, NULL, RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL}
-  ,
-  {RECT_CONFIG, "proxy.config.log.common_log_enabled", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL}
-  ,
-  {RECT_CONFIG, "proxy.config.log.common_log_is_ascii", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL}
-  ,
-  {RECT_CONFIG, "proxy.config.log.common_log_name", RECD_STRING, "common", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[^[:space:]]*$", RECA_NULL}
-  ,
-  {RECT_CONFIG, "proxy.config.log.common_log_header", RECD_STRING, NULL, RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL}
-  ,
-  {RECT_CONFIG, "proxy.config.log.extended_log_enabled", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL}
-  ,
-  {RECT_CONFIG, "proxy.config.log.extended_log_is_ascii", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL}
-  ,
-  {RECT_CONFIG, "proxy.config.log.extended_log_name", RECD_STRING, "extended", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[^[:space:]]*$", RECA_NULL}
-  ,
-  {RECT_CONFIG, "proxy.config.log.extended_log_header", RECD_STRING, NULL, RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL}
-  ,
-  {RECT_CONFIG, "proxy.config.log.extended2_log_enabled", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL}
-  ,
-  {RECT_CONFIG, "proxy.config.log.extended2_log_is_ascii", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL}
-  ,
-  {RECT_CONFIG, "proxy.config.log.extended2_log_name", RECD_STRING, "extended2", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[^[:space:]]*$", RECA_NULL}
-  ,
-  {RECT_CONFIG, "proxy.config.log.extended2_log_header", RECD_STRING, NULL, RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL}
-  ,
   {RECT_CONFIG, "proxy.config.log.separate_icp_logs", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL}
   ,
   {RECT_CONFIG, "proxy.config.log.separate_host_logs", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL}

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5c2b032f/proxy/config/logs_xml.config.default
----------------------------------------------------------------------
diff --git a/proxy/config/logs_xml.config.default b/proxy/config/logs_xml.config.default
index 37041b3..9c4c540 100644
--- a/proxy/config/logs_xml.config.default
+++ b/proxy/config/logs_xml.config.default
@@ -387,3 +387,38 @@ simply create a <LogObject> that uses this format.
   <Name = "squid_seconds_only_timestamp"/>
   <Format = "%<cqts> %<ttms> %<chi> %<crc>/%<pssc> %<psql> %<cqhm> %<cquc> %<caun> %<phr>/%<pqsn> %<psct>"/>
 </LogFormat>
+
+
+<!------------------------------------------------------------------------
+
+Squid, Common, Extended, Extended2 Formats
+--------------------------------------------------
+
+The following <LogFormat> formats are formerly built-in log-formats.
+-------------------------------------------------------------------------->
+
+<LogFormat>
+  <Name = "squid"/>
+  <Format = "%<cqtq> %<ttms> %<chi> %<crc>/%<pssc> %<psql> %<cqhm> %<cquc> %<caun> %<phr>/%<pqsn> %<psct>"/>
+</LogFormat>
+
+<LogFormat>
+  <Name = "common"/>
+  <Format = "%<chi> - %<caun> [%<cqtn>] \"%<cqtx>\" %<pssc> %<pscl>"/>
+</LogFormat>
+
+<LogFormat>
+  <Name = "extended"/>
+  <Format = "%<chi> - %<caun> [%<cqtn>] \"%<cqtx>\" %<pssc> %<pscl> %<sssc> %<sscl> %<cqbl> %<pqbl> %<cqhl> %<pshl> %<pqhl> %<sshl> %<tts>"/>
+</LogFormat>
+
+<LogFormat>
+  <Name = "extended2"/>
+  <Format = "%<chi> - %<caun> [%<cqtn>] \"%<cqtx>\" %<pssc> %<pscl> %<sssc> %<sscl> %<cqbl> %<pqbl> %<cqhl> %<pshl> %<pqhl> %<sshl> %<tts> %<phr> %<cfsc> %<pfsc> %<crc>"/>
+</LogFormat>
+
+<LogObject>
+    <Format = "squid"/>
+    <Filename = "squid"/>
+    <Mode = "binary"/>
+</LogObject>

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5c2b032f/proxy/config/records.config.default.in
----------------------------------------------------------------------
diff --git a/proxy/config/records.config.default.in b/proxy/config/records.config.default.in
index 4c323a6..813d46d 100644
--- a/proxy/config/records.config.default.in
+++ b/proxy/config/records.config.default.in
@@ -142,8 +142,6 @@ CONFIG proxy.config.cache.min_average_object_size INT 8000
 CONFIG proxy.config.log.logging_enabled INT 3
 CONFIG proxy.config.log.max_space_mb_for_logs INT 25000
 CONFIG proxy.config.log.max_space_mb_headroom INT 1000
-CONFIG proxy.config.log.squid_log_enabled INT 1
-CONFIG proxy.config.log.squid_log_is_ascii INT 0
 CONFIG proxy.config.log.rolling_enabled INT 1
 CONFIG proxy.config.log.rolling_interval_sec INT 86400
 CONFIG proxy.config.log.rolling_size_mb INT 10

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5c2b032f/proxy/logcat.cc
----------------------------------------------------------------------
diff --git a/proxy/logcat.cc b/proxy/logcat.cc
index 0c241f2..1133c07 100644
--- a/proxy/logcat.cc
+++ b/proxy/logcat.cc
@@ -42,7 +42,6 @@
 #include "LogBuffer.h"
 #include "LogUtils.h"
 #include "LogSock.h"
-#include "LogPredefined.h"
 #include "Log.h"
 
 // logcat-specific command-line flags
@@ -149,15 +148,6 @@ process_file(int in_fd, int out_fd)
     // line
     //
     const char *alt_format = NULL;
-    if (squid_flag)
-      alt_format = PreDefinedFormatInfo::squid;
-    if (clf_flag)
-      alt_format = PreDefinedFormatInfo::common;
-    if (elf_flag)
-      alt_format = PreDefinedFormatInfo::extended;
-    if (elf2_flag)
-      alt_format = PreDefinedFormatInfo::extended2;
-
     // convert the buffer to ascii entries and place onto stdout
     //
     if (header->fmt_fieldlist()) {

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5c2b032f/proxy/logging/LogConfig.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogConfig.cc b/proxy/logging/LogConfig.cc
index 877454e..63189ee 100644
--- a/proxy/logging/LogConfig.cc
+++ b/proxy/logging/LogConfig.cc
@@ -48,7 +48,6 @@
 #include "SimpleTokenizer.h"
 
 #include "LogCollationAccept.h"
-#include "LogPredefined.h"
 
 #define DISK_IS_CONFIG_FULL_MESSAGE                    \
   "Access logging to local log directory suspended - " \
@@ -85,26 +84,6 @@ LogConfig::setup_default_values()
   separate_icp_logs = 1;
   separate_host_logs = false;
 
-  squid_log_enabled = true;
-  squid_log_is_ascii = true;
-  squid_log_name = ats_strdup("squid");
-  squid_log_header = NULL;
-
-  common_log_enabled = false;
-  common_log_is_ascii = true;
-  common_log_name = ats_strdup("common");
-  common_log_header = NULL;
-
-  extended_log_enabled = false;
-  extended_log_is_ascii = true;
-  extended_log_name = ats_strdup("extended");
-  extended_log_header = NULL;
-
-  extended2_log_enabled = false;
-  extended2_log_is_ascii = true;
-  extended2_log_name = ats_strdup("extended2");
-  extended2_log_header = NULL;
-
   collation_mode = Log::NO_COLLATION;
   collation_host = ats_strdup("none");
   collation_port = 0;
@@ -237,84 +216,6 @@ LogConfig::read_configuration_variables()
   //   "proxy.config.log.<format>_log_header" STRING
   //
 
-
-  // SQUID
-  val = (int)REC_ConfigReadInteger("proxy.config.log.squid_log_enabled");
-  squid_log_enabled = (val > 0);
-
-  val = (int)REC_ConfigReadInteger("proxy.config.log.squid_log_is_ascii");
-  squid_log_is_ascii = (val > 0);
-
-  ptr = REC_ConfigReadString("proxy.config.log.squid_log_name");
-  if (ptr != NULL) {
-    ats_free(squid_log_name);
-    squid_log_name = ptr;
-  }
-
-  ptr = REC_ConfigReadString("proxy.config.log.squid_log_header");
-  if (ptr != NULL) {
-    ats_free(squid_log_header);
-    squid_log_header = ptr;
-  }
-
-  // COMMON
-  val = (int)REC_ConfigReadInteger("proxy.config.log.common_log_enabled");
-  common_log_enabled = (val > 0);
-
-  val = (int)REC_ConfigReadInteger("proxy.config.log.common_log_is_ascii");
-  common_log_is_ascii = (val > 0);
-
-  ptr = REC_ConfigReadString("proxy.config.log.common_log_name");
-  if (ptr != NULL) {
-    ats_free(common_log_name);
-    common_log_name = ptr;
-  }
-
-  ptr = REC_ConfigReadString("proxy.config.log.common_log_header");
-  if (ptr != NULL) {
-    ats_free(common_log_header);
-    common_log_header = ptr;
-  }
-
-  // EXTENDED
-  val = (int)REC_ConfigReadInteger("proxy.config.log.extended_log_enabled");
-  extended_log_enabled = (val > 0);
-
-  val = (int)REC_ConfigReadInteger("proxy.config.log.extended_log_is_ascii");
-  extended_log_is_ascii = (val > 0);
-
-  ptr = REC_ConfigReadString("proxy.config.log.extended_log_name");
-  if (ptr != NULL) {
-    ats_free(extended_log_name);
-    extended_log_name = ptr;
-  }
-
-  ptr = REC_ConfigReadString("proxy.config.log.extended_log_header");
-  if (ptr != NULL) {
-    ats_free(extended_log_header);
-    extended_log_header = ptr;
-  }
-
-  // EXTENDED2
-  val = (int)REC_ConfigReadInteger("proxy.config.log.extended2_log_enabled");
-  extended2_log_enabled = (val > 0);
-
-  val = (int)REC_ConfigReadInteger("proxy.config.log.extended2_log_is_ascii");
-  extended2_log_is_ascii = (val > 0);
-
-  ptr = REC_ConfigReadString("proxy.config.log.extended2_log_name");
-  if (ptr != NULL) {
-    ats_free(extended2_log_name);
-    extended2_log_name = ptr;
-  }
-
-  ptr = REC_ConfigReadString("proxy.config.log.extended2_log_header");
-  if (ptr != NULL) {
-    ats_free(extended2_log_header);
-    extended2_log_header = ptr;
-  }
-
-
   // SPLITTING
   // 0 means no splitting
   // 1 means splitting
@@ -457,14 +358,6 @@ LogConfig::~LogConfig()
 
   ats_free(hostname);
   ats_free(logfile_dir);
-  ats_free(squid_log_name);
-  ats_free(squid_log_header);
-  ats_free(common_log_name);
-  ats_free(common_log_header);
-  ats_free(extended_log_name);
-  ats_free(extended_log_header);
-  ats_free(extended2_log_name);
-  ats_free(extended2_log_header);
   ats_free(collation_host);
   ats_free(collation_secret);
   ats_free(m_dir_entry);
@@ -553,19 +446,8 @@ LogConfig::init(LogConfig *prev_config)
   }
 
   // ----------------------------------------------------------------------
-  // Construct a new error log object candidate.
-  if (Log::error_logging_enabled()) {
-    PreDefinedFormatInfo *info;
-
-    Debug("log", "creating predefined error log object");
-    info = MakePredefinedErrorLog(this);
-    errlog = this->create_predefined_object(info, 0, NULL);
-    errlog->set_fmt_timestamps();
-    delete info;
-  } else {
-    Log::error_log = NULL;
-  }
-
+  Log::error_log = NULL;
+  
   if (prev_config) {
     // Transfer objects from previous configuration.
     transfer_objects(prev_config);
@@ -614,22 +496,6 @@ LogConfig::display(FILE *fd)
   fprintf(fd, "   hostname = %s\n", hostname);
   fprintf(fd, "   logfile_dir = %s\n", logfile_dir);
   fprintf(fd, "   logfile_perm = 0%o\n", logfile_perm);
-  fprintf(fd, "   squid_log_enabled = %d\n", squid_log_enabled);
-  fprintf(fd, "   squid_log_is_ascii = %d\n", squid_log_is_ascii);
-  fprintf(fd, "   squid_log_name = %s\n", squid_log_name);
-  fprintf(fd, "   squid_log_header = %s\n", squid_log_header ? squid_log_header : "<no header defined>");
-  fprintf(fd, "   common_log_enabled = %d\n", common_log_enabled);
-  fprintf(fd, "   common_log_is_ascii = %d\n", common_log_is_ascii);
-  fprintf(fd, "   common_log_name = %s\n", common_log_name);
-  fprintf(fd, "   common_log_header = %s\n", common_log_header ? common_log_header : "<no header defined>");
-  fprintf(fd, "   extended_log_enabled = %d\n", extended_log_enabled);
-  fprintf(fd, "   extended_log_is_ascii = %d\n", extended_log_is_ascii);
-  fprintf(fd, "   extended_log_name = %s\n", extended_log_name);
-  fprintf(fd, "   extended_log_header = %s\n", extended_log_header ? extended_log_header : "<no header defined>");
-  fprintf(fd, "   extended2_log_enabled = %d\n", extended2_log_enabled);
-  fprintf(fd, "   extended2_log_is_ascii = %d\n", extended2_log_is_ascii);
-  fprintf(fd, "   extended2_log_name = %s\n", extended2_log_name);
-  fprintf(fd, "   extended2_log_header = %s\n", extended2_log_header ? extended2_log_header : "<no header defined>");
   fprintf(fd, "   separate_icp_logs = %d\n", separate_icp_logs);
   fprintf(fd, "   separate_host_logs = %d\n", separate_host_logs);
   fprintf(fd, "   collation_mode = %d\n", collation_mode);
@@ -659,86 +525,6 @@ LogConfig::display(FILE *fd)
 }
 
 //-----------------------------------------------------------------------------
-// Create one object for each of the entries in the pre-defined info list
-// and apply the specified filter(s) to it.
-//
-// Normally, only one pre-defined format has been selected on the config file
-// so this function creates a single object in such case.
-//
-// This function adds the pre-defined objects to the global_object_list.
-//
-
-LogObject *
-LogConfig::create_predefined_object(const PreDefinedFormatInfo *pdi, size_t num_filters, LogFilter **filter, const char *filt_name,
-                                    bool force_extension)
-{
-  const char *obj_fname;
-  char obj_filt_fname[PATH_NAME_MAX];
-
-  ink_release_assert(pdi != NULL);
-
-  if (filt_name) {
-    ink_string_concatenate_strings_n(obj_filt_fname, PATH_NAME_MAX, pdi->filename, "-", filt_name, NULL);
-    obj_fname = obj_filt_fname;
-  } else {
-    obj_fname = pdi->filename;
-  }
-
-  if (force_extension) {
-    switch (pdi->filefmt) {
-    case LOG_FILE_ASCII:
-      ink_string_append(obj_filt_fname, (char *)LOG_FILE_ASCII_OBJECT_FILENAME_EXTENSION, PATH_NAME_MAX);
-      break;
-    case LOG_FILE_BINARY:
-      ink_string_append(obj_filt_fname, (char *)LOG_FILE_BINARY_OBJECT_FILENAME_EXTENSION, PATH_NAME_MAX);
-      break;
-    default:
-      break;
-    }
-  }
-
-  // create object with filters
-  //
-  LogObject *obj;
-  obj = new LogObject(pdi->format, logfile_dir, obj_fname, pdi->filefmt, pdi->header, (Log::RollingEnabledValues)rolling_enabled,
-                      collation_preproc_threads, rolling_interval_sec, rolling_offset_hr, rolling_size_mb);
-
-  if (pdi->collatable) {
-    if (collation_mode == Log::SEND_STD_FMTS || collation_mode == Log::SEND_STD_AND_NON_XML_CUSTOM_FMTS) {
-      LogHost *loghost = new LogHost(obj->get_full_filename(), obj->get_signature());
-      ink_assert(loghost != NULL);
-
-      loghost->set_name_port(collation_host, collation_port);
-      obj->add_loghost(loghost, false);
-    }
-  }
-
-  for (size_t i = 0; i < num_filters; ++i) {
-    obj->add_filter(filter[i]);
-  }
-
-  // give object to object manager
-  if (log_object_manager.manage_object(obj) != LogObjectManager::NO_FILENAME_CONFLICTS) {
-    delete obj;
-    return NULL;
-  }
-
-  return obj;
-}
-
-void
-LogConfig::create_predefined_objects_with_filter(const PreDefinedFormatList &predef, size_t nfilters, LogFilter **filters,
-                                                 const char *filt_name, bool force_extension)
-{
-  PreDefinedFormatInfo *pdi;
-
-  for (pdi = predef.formats.head; pdi != NULL; pdi = (pdi->link).next) {
-    this->create_predefined_object(pdi, nfilters, filters, filt_name, force_extension);
-  }
-}
-
-
-//-----------------------------------------------------------------------------
 // split_by_protocol
 //
 // This function creates the objects needed to log different protocols on
@@ -752,7 +538,7 @@ LogConfig::create_predefined_objects_with_filter(const PreDefinedFormatList &pre
 // pre-defined formats.
 //
 LogFilter *
-LogConfig::split_by_protocol(const PreDefinedFormatList &predef)
+LogConfig::split_by_protocol()
 {
   if (!separate_icp_logs) {
     return NULL;
@@ -764,7 +550,6 @@ LogConfig::split_by_protocol(const PreDefinedFormatList &predef)
   };
 
   int64_t value[] = {LOG_ENTRY_ICP, LOG_ENTRY_HTTP};
-  const char *name[] = {"icp", "http"};
   const char *filter_name[] = {"__icp__", "__http__"};
   int64_t filter_val[http]; // protocols to reject
   size_t n = 0;
@@ -777,7 +562,6 @@ LogConfig::split_by_protocol(const PreDefinedFormatList &predef)
       LogFilter *filter[1];
 
       filter[0] = new LogFilterInt(filter_name[icp], etype_field, LogFilter::ACCEPT, LogFilter::MATCH, value[icp]);
-      create_predefined_objects_with_filter(predef, countof(filter), filter, name[icp]);
       delete filter[0];
     }
     filter_val[n++] = value[icp];
@@ -798,7 +582,7 @@ LogConfig::split_by_protocol(const PreDefinedFormatList &predef)
 }
 
 size_t
-LogConfig::split_by_hostname(const PreDefinedFormatList &predef, LogFilter *reject_protocol_filter)
+LogConfig::split_by_hostname(LogFilter *reject_protocol_filter)
 {
   size_t n_hosts;
   char **host = read_log_hosts_file(&n_hosts); // allocates memory for array
@@ -821,7 +605,6 @@ LogConfig::split_by_hostname(const PreDefinedFormatList &predef, LogFilter *reje
       rp_ah[num_filt] =
         new LogFilterString(filter_name, shn_field, LogFilter::ACCEPT, LogFilter::CASE_INSENSITIVE_CONTAIN, host[i]);
 
-      create_predefined_objects_with_filter(predef, num_filt + 1, rp_ah, host[i], true);
       delete rp_ah[num_filt];
     }
 
@@ -840,7 +623,7 @@ LogConfig::split_by_hostname(const PreDefinedFormatList &predef, LogFilter *reje
     // hosts other than those specified in the hosts file and for
     // those protocols that do not have their own file
     //
-    create_predefined_objects_with_filter(predef, num_filt + 1, rp_rh);
+
     delete rp_rh[num_filt];
 
     delete[] host; // deallocate memory allocated by
@@ -862,8 +645,6 @@ LogConfig::split_by_hostname(const PreDefinedFormatList &predef, LogFilter *reje
 //
 // Upon return from this function:
 // - global_object_list has the aforementioned objects
-// - global_format_list has all the pre-determined log formats (e.g. squid,
-//   common, etc.)
 // - global_filter_list has all custom filters
 //   Note that the filters necessary to do log splitting for the pre defined
 //   format are kept private (e.g., they do not go to the global_filter_list).
@@ -874,39 +655,6 @@ LogConfig::setup_log_objects()
   Debug("log", "creating objects...");
 
   // ----------------------------------------------------------------------
-  // Construct the LogObjects for the pre-defined formats.
-
-  // gather the config information for the pre-defined formats
-  //
-  PreDefinedFormatList predef;
-
-  predef.init(this);
-
-  // do protocol splitting
-  //
-  LogFilter *reject_protocol_filter = split_by_protocol(predef);
-
-  // do host splitting
-  //
-  size_t num_hosts = 0;
-  if (separate_host_logs) {
-    num_hosts = split_by_hostname(predef, reject_protocol_filter);
-  }
-
-  if (num_hosts == 0) {
-    // if no host splitting was requested, or if host splitting
-    // was not successful (e.g. empty log_hosts.config file) then
-    // create the "catch-all" object that contains logs for all
-    // protocols that do not have their own file, and for all hosts
-    //
-    LogFilter *f[1];
-    f[0] = reject_protocol_filter;
-    create_predefined_objects_with_filter(predef, countof(f), f);
-  }
-
-  delete reject_protocol_filter;
-
-  // ----------------------------------------------------------------------
   // Construct the LogObjects for the custom formats
 
   global_filter_list.clear();
@@ -957,13 +705,8 @@ LogConfig::register_config_callbacks()
   static const char *names[] = {
     "proxy.config.log.log_buffer_size", "proxy.config.log.max_secs_per_buffer", "proxy.config.log.max_space_mb_for_logs",
     "proxy.config.log.max_space_mb_for_orphan_logs", "proxy.config.log.max_space_mb_headroom", "proxy.config.log.logfile_perm",
-    "proxy.config.log.hostname", "proxy.config.log.logfile_dir", "proxy.config.log.squid_log_enabled",
-    "proxy.config.log.squid_log_is_ascii", "proxy.config.log.squid_log_name", "proxy.config.log.squid_log_header",
-    "proxy.config.log.common_log_enabled", "proxy.config.log.common_log_is_ascii", "proxy.config.log.common_log_name",
-    "proxy.config.log.common_log_header", "proxy.config.log.extended_log_enabled", "proxy.config.log.extended_log_is_ascii",
-    "proxy.config.log.extended_log_name", "proxy.config.log.extended_log_header", "proxy.config.log.extended2_log_enabled",
-    "proxy.config.log.extended2_log_is_ascii", "proxy.config.log.extended2_log_name", "proxy.config.log.extended2_log_header",
-    "proxy.config.log.separate_icp_logs", "proxy.config.log.separate_host_logs", "proxy.local.log.collation_mode",
+    "proxy.config.log.hostname", "proxy.config.log.logfile_dir", "proxy.config.log.separate_icp_logs", 
+    "proxy.config.log.separate_host_logs", "proxy.local.log.collation_mode",
     "proxy.config.log.collation_host", "proxy.config.log.collation_port", "proxy.config.log.collation_host_tagged",
     "proxy.config.log.collation_secret", "proxy.config.log.collation_retry_sec", "proxy.config.log.collation_max_send_buffers",
     "proxy.config.log.rolling_enabled", "proxy.config.log.rolling_interval_sec", "proxy.config.log.rolling_offset_hr",

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5c2b032f/proxy/logging/LogConfig.h
----------------------------------------------------------------------
diff --git a/proxy/logging/LogConfig.h b/proxy/logging/LogConfig.h
index 96eae0a..c4310ad 100644
--- a/proxy/logging/LogConfig.h
+++ b/proxy/logging/LogConfig.h
@@ -74,32 +74,27 @@ extern RecRawStatBlock *log_rsb;
 
 struct dirent;
 struct LogCollationAccept;
-struct PreDefinedFormatList;
-struct PreDefinedFormatInfo;
-
 /*-------------------------------------------------------------------------
-  LogConfig
-
-  This object keeps the state of the logging configuraion variables.  Upon
+  this object keeps the state of the logging configuraion variables.  upon
   construction, the log configuration file is read and the logging
   variables are initialized.
 
-  The "global" LogConfig object is kept as a static pointer in the Log
+  the "global" logconfig object is kept as a static pointer in the log
   class, called "config", and changed whenever the configuration variables
-  are changed in the config file, using Log::change_configuration().
-
-  To add a new config variable:
-     1. Add a line in records.config for the new config variable.
-        The name in records.config should be "proxy.config.log.xxx".
-     2. Create a member variable to store the current value.
-        The name of the member variable should be "xxx".
-     3. If the member variable is a string, add a delete for it in the
-        destructor, LogConfig::~LogConfig.
-     4. Initialize the member variable in LogConfig::setup_default_values
-     5. Update the member variable from the records.config file
-        in LogConfig::read_configuration_variables() using a call to
-        ConfigReadInteger or ConfigReadString.
-     6. Add a line in the LogConfig::register_config_callbacks() function
+  are changed in the config file, using log::change_configuration().
+
+  to add a new config variable:
+     1. add a line in records.config for the new config variable.
+        the name in records.config should be "proxy.config.log.xxx".
+     2. create a member variable to store the current value.
+        the name of the member variable should be "xxx".
+     3. if the member variable is a string, add a delete for it in the
+        destructor, logconfig::~logconfig.
+     4. initialize the member variable in logconfig::setup_default_values
+     5. update the member variable from the records.config file
+        in logconfig::read_configuration_variables() using a call to
+        configreadinteger or configreadstring.
+     6. add a line in the logconfig::register_config_callbacks() function
         for this new variable if it is exposed in the GUI
   -------------------------------------------------------------------------*/
 
@@ -181,14 +176,6 @@ public:
   int max_space_mb_for_orphan_logs;
   int max_space_mb_headroom;
   int logfile_perm;
-  bool squid_log_enabled;
-  bool squid_log_is_ascii;
-  bool common_log_enabled;
-  bool common_log_is_ascii;
-  bool extended_log_enabled;
-  bool extended_log_is_ascii;
-  bool extended2_log_enabled;
-  bool extended2_log_is_ascii;
   bool separate_icp_logs;
   bool separate_host_logs;
   int collation_mode;
@@ -213,14 +200,6 @@ public:
 
   char *hostname;
   char *logfile_dir;
-  char *squid_log_name;
-  char *squid_log_header;
-  char *common_log_name;
-  char *common_log_header;
-  char *extended_log_name;
-  char *extended_log_header;
-  char *extended2_log_name;
-  char *extended2_log_header;
   char *collation_host;
   char *collation_secret;
 
@@ -230,12 +209,9 @@ private:
 
   void setup_default_values();
   void setup_collation(LogConfig *prev_config);
-  LogFilter *split_by_protocol(const PreDefinedFormatList &pre_def_info_list);
-  size_t split_by_hostname(const PreDefinedFormatList &pre_def_info_list, LogFilter *reject_protocol);
-  LogObject *create_predefined_object(const PreDefinedFormatInfo *pdi, size_t nfilters, LogFilter **filters,
-                                      const char *filt_name = 0, bool force_extension = false);
-  void create_predefined_objects_with_filter(const PreDefinedFormatList &pre_def_info_list, size_t nfilters, LogFilter **filters,
-                                             const char *filt_name = 0, bool force_extension = false);
+  
+  LogFilter *split_by_protocol();
+  size_t split_by_hostname(LogFilter *reject_protocol);
 
 private:
   // if true, use max_space_mb_for_orphan_logs to determine the amount

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5c2b032f/proxy/logging/LogPredefined.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogPredefined.cc b/proxy/logging/LogPredefined.cc
deleted file mode 100644
index 75c1705..0000000
--- a/proxy/logging/LogPredefined.cc
+++ /dev/null
@@ -1,113 +0,0 @@
-/** @file
-
-  This file implements predefined log formats
-
-  @section license License
-
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
- */
-
-#include "LogObject.h"
-#include "LogConfig.h"
-#include "LogFormat.h"
-#include "LogPredefined.h"
-
-// predefined formats
-const char *const PreDefinedFormatInfo::squid =
-  "%<cqtq> %<ttms> %<chi> %<crc>/%<pssc> %<psql> %<cqhm> %<cquc> %<caun> %<phr>/%<pqsn> %<psct>";
-
-const char *const PreDefinedFormatInfo::common = "%<chi> - %<caun> [%<cqtn>] \"%<cqtx>\" %<pssc> %<pscl>";
-
-const char *const PreDefinedFormatInfo::extended = "%<chi> - %<caun> [%<cqtn>] \"%<cqtx>\" %<pssc> %<pscl> "
-                                                   "%<sssc> %<sscl> %<cqbl> %<pqbl> %<cqhl> %<pshl> %<pqhl> %<sshl> %<tts>";
-
-const char *const PreDefinedFormatInfo::extended2 =
-  "%<chi> - %<caun> [%<cqtn>] \"%<cqtx>\" %<pssc> %<pscl> "
-  "%<sssc> %<sscl> %<cqbl> %<pqbl> %<cqhl> %<pshl> %<pqhl> %<sshl> %<tts> %<phr> %<cfsc> %<pfsc> %<crc>";
-
-PreDefinedFormatInfo *
-MakePredefinedErrorLog(LogConfig *config)
-{
-  LogFormat *fmt;
-
-  fmt = MakeTextLogFormat("error");
-  config->global_format_list.add(fmt, false);
-
-  // The error log is always ASCII, and currently does not work correctly with log collation.
-  return new PreDefinedFormatInfo(fmt, "error.log", NULL /* no log header */, LOG_FILE_ASCII, false);
-}
-
-PreDefinedFormatList::PreDefinedFormatList()
-{
-}
-
-PreDefinedFormatList::~PreDefinedFormatList()
-{
-  PreDefinedFormatInfo *info;
-  while (!this->formats.empty()) {
-    info = this->formats.pop();
-    delete info;
-  }
-}
-
-void
-PreDefinedFormatList::init(LogConfig *config)
-{
-  LogFormat *fmt;
-
-// All these predefined formats work with log collation. They are optionally binary or ASCII, each
-// with a different config option.
-#define make_format(is_ascii) ((is_ascii) ? LOG_FILE_ASCII : LOG_FILE_BINARY)
-
-  fmt = new LogFormat("squid", PreDefinedFormatInfo::squid);
-  config->global_format_list.add(fmt, false);
-  Debug("log", "squid format added to the global format list");
-
-  if (config->squid_log_enabled) {
-    this->formats.enqueue(new PreDefinedFormatInfo(fmt, config->squid_log_name, config->squid_log_header,
-                                                   make_format(config->squid_log_is_ascii), true));
-  }
-
-  fmt = new LogFormat("common", PreDefinedFormatInfo::common);
-  config->global_format_list.add(fmt, false);
-  Debug("log", "common format added to the global format list");
-
-  if (config->common_log_enabled) {
-    this->formats.enqueue(new PreDefinedFormatInfo(fmt, config->common_log_name, config->common_log_header,
-                                                   make_format(config->common_log_is_ascii), true));
-  }
-
-  fmt = new LogFormat("extended", PreDefinedFormatInfo::extended);
-  config->global_format_list.add(fmt, false);
-  Debug("log", "extended format added to the global format list");
-
-  if (config->extended_log_enabled) {
-    this->formats.enqueue(new PreDefinedFormatInfo(fmt, config->extended_log_name, config->extended_log_header,
-                                                   make_format(config->extended_log_is_ascii), true));
-  }
-
-  fmt = new LogFormat("extended2", PreDefinedFormatInfo::extended2);
-  config->global_format_list.add(fmt, false);
-  Debug("log", "extended2 format added to the global format list");
-
-  if (config->extended2_log_enabled) {
-    this->formats.enqueue(new PreDefinedFormatInfo(fmt, config->extended2_log_name, config->extended2_log_header,
-                                                   make_format(config->extended2_log_is_ascii), true));
-  }
-
-#undef make_format
-}

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5c2b032f/proxy/logging/LogPredefined.h
----------------------------------------------------------------------
diff --git a/proxy/logging/LogPredefined.h b/proxy/logging/LogPredefined.h
deleted file mode 100644
index 3c14715..0000000
--- a/proxy/logging/LogPredefined.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/** @file
-
-  A brief file description
-
-  @section license License
-
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
- */
-
-#ifndef LOG_PREDEFINED_H
-#define LOG_PREDEFINED_H
-
-#include "libts.h"
-
-class LogFormat;
-class LogConfig;
-
-// Collects all the necesary info to build a pre-defined object.
-struct PreDefinedFormatInfo {
-  LogFormat *format;
-  const char *filename;
-  const char *header;
-  LogFileFormat filefmt;
-  bool collatable; // whether log collation is supported
-
-  LINK(PreDefinedFormatInfo, link);
-
-  PreDefinedFormatInfo(LogFormat *fmt, const char *fname, const char *hdr, LogFileFormat _f, bool _c)
-    : format(fmt), filename(fname), header(hdr), filefmt(_f), collatable(_c)
-  {
-  }
-
-  static const char *const squid;
-  static const char *const common;
-  static const char *const extended;
-  static const char *const extended2;
-};
-
-typedef Queue<PreDefinedFormatInfo> PreDefinedFormatInfoList;
-
-struct PreDefinedFormatList {
-  PreDefinedFormatList();
-  ~PreDefinedFormatList();
-
-  // Initialize the predefined format list from the given LogConfig. This has the side-effect of
-  // adding the predefined LogFormats to the LogConfig global_format_list.
-  void init(LogConfig *config);
-
-  PreDefinedFormatInfoList formats;
-};
-
-// Return a PreDefinedFormatInfo structure for the ASCII error log.
-PreDefinedFormatInfo *MakePredefinedErrorLog(LogConfig *config);
-
-#endif /* LOG_PREDEFINED_H */

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5c2b032f/proxy/logging/Makefile.am
----------------------------------------------------------------------
diff --git a/proxy/logging/Makefile.am b/proxy/logging/Makefile.am
index df61ffc..080f3c6 100644
--- a/proxy/logging/Makefile.am
+++ b/proxy/logging/Makefile.am
@@ -64,8 +64,6 @@ liblogging_a_SOURCES = \
   LogLimits.h \
   LogObject.cc \
   LogObject.h \
-  LogPredefined.cc \
-  LogPredefined.h \
   LogSock.cc \
   LogSock.h \
   LogUtils.cc \

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5c2b032f/tools/traffic_shell.pl
----------------------------------------------------------------------
diff --git a/tools/traffic_shell.pl b/tools/traffic_shell.pl
index 8ce101d..4a13627 100755
--- a/tools/traffic_shell.pl
+++ b/tools/traffic_shell.pl
@@ -523,34 +523,6 @@ sub show_logging {
   my $preproc_threads = get_on_off("proxy.config.log.collation_preproc_threads");
   my $orphan_space = get_int("proxy.config.log.max_space_mb_for_orphan_logs");
 
-  my $squid_log = get_on_off("proxy.config.log.squid_log_enabled");
-  my $squid_is_ascii = get_switch("proxy.config.log.squid_log_is_ascii", {
-    "0" => "BINARY",
-    "default" => "ASCII"});
-  my $squid_file_name = get_string("proxy.config.log.squid_log_name");
-  my $squid_file_header = get_string("proxy.config.log.squid_log_header");
-  
-  my $common_log = get_on_off("proxy.config.log.common_log_enabled");
-  my $common_is_ascii = get_switch("proxy.config.log.common_log_is_ascii", {
-    "0" => "BINARY",
-    "default" => "ASCII"});
-  my $common_file_name = get_string("proxy.config.log.common_log_name");
-  my $common_file_header = get_string("proxy.config.log.common_log_header");
-  
-  my $extended_log = get_on_off("proxy.config.log.extended_log_enabled");
-  my $extended_is_ascii = get_switch("proxy.config.log.extended_log_is_ascii", {
-    "0" => "BINARY",
-    "default" => "ASCII"});
-  my $extended_file_name = get_string("proxy.config.log.extended_log_name");
-  my $extended_file_header = get_string("proxy.config.log.extended_log_header");
-  
-  my $extended2_log = get_on_off("proxy.config.log.extended2_log_enabled");
-  my $extended2_is_ascii = get_switch("proxy.config.log.extended2_log_is_ascii", {
-    "0" => "BINARY",
-    "default" => "ASCII"});
-  my $extended2_file_name = get_string("proxy.config.log.extended2_log_name");
-  my $extended2_file_header = get_string("proxy.config.log.extended2_log_header");
-  
   my $icp_log = get_on_off("proxy.config.log.separate_icp_logs");
   my $http_host_log = get_on_off("proxy.config.log.separate_host_logs");
 
@@ -576,26 +548,6 @@ Log Collation ---------------------------- $collation_mode
   Preproc Threads ------------------------ $preproc_threads
   Space Limit for Orphan Files ----------- $orphan_space MB
 
-Squid Format ----------------------------- $squid_log
-  File Type ------------------------------ $squid_is_ascii
-  File Name ------------------------------ $squid_file_name
-  File Header ---------------------------- $squid_file_header
-
-Netscape Common -------------------------- $common_log
-  File Type ------------------------------ $common_is_ascii
-  File Name ------------------------------ $common_file_name
-  File Header ---------------------------- $common_file_header
-
-Netscape Extended ------------------------ $extended_log
-  File Type ------------------------------ $extended_is_ascii
-  File Name ------------------------------ $extended_file_name
-  File Header ---------------------------- $extended_file_header
-
-Netscape Extended2 ----------------------- $extended2_log
-  File Type ------------------------------ $extended2_is_ascii
-  File Name   ---------------------------- $extended2_file_name
-  File Header ---------------------------- $extended2_file_header
-
 Splitting
   ICP Log Splitting ---------------------- $icp_log
   HTTP Host Log Splitting ---------------- $http_host_log


[2/2] trafficserver git commit: TS-1985: clang-format

Posted by so...@apache.org.
TS-1985: clang-format


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/9236bb73
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/9236bb73
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/9236bb73

Branch: refs/heads/master
Commit: 9236bb738db2cdcab6174a619f25c89190aa0e3a
Parents: 5c2b032
Author: Phil Sorber <so...@apache.org>
Authored: Tue Jun 16 12:13:24 2015 -0600
Committer: Phil Sorber <so...@apache.org>
Committed: Tue Jun 16 12:13:24 2015 -0600

----------------------------------------------------------------------
 doc/admin/working-log-files.en.rst                |  6 +++---
 doc/reference/configuration/records.config.en.rst |  2 +-
 proxy/logging/LogConfig.cc                        | 18 +++++++++---------
 proxy/logging/LogConfig.h                         |  2 +-
 4 files changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9236bb73/doc/admin/working-log-files.en.rst
----------------------------------------------------------------------
diff --git a/doc/admin/working-log-files.en.rst b/doc/admin/working-log-files.en.rst
index 0ac2d1d..85f1fd3 100644
--- a/doc/admin/working-log-files.en.rst
+++ b/doc/admin/working-log-files.en.rst
@@ -222,8 +222,8 @@ analyzed with a wide variety of off-the-shelf log-analysis packages. You
 should use one of the standard event log formats unless you need
 information that these formats do not provide. Refer to `Using the Custom Format`_.
 
-#. Log formats are now configured and enabled via :file:`logs_xml.config`. 
-   Here are four example log formats, which match with the previous configurations (set formerly in :file:`records.config`). 
+#. Log formats are now configured and enabled via :file:`logs_xml.config`.
+   Here are four example log formats, which match with the previous configurations (set formerly in :file:`records.config`).
    -  :ts:cv: [format]_log_enabled
    -  :ts:cv: [format]_is_ascii
    -  :ts:cv: [format]_name
@@ -232,7 +232,7 @@ information that these formats do not provide. Refer to `Using the Custom Format
 The [format] specified can be squid (Squid), common (Netscape Common),
 extended (Netscape Extended), or extended2 (Netscape Extended 2).
 
-Note that the squid log object is created by default, and will be used if logging is enabled. 
+Note that the squid log object is created by default, and will be used if logging is enabled.
 Users can use any number of log formats and create any number of log objects via the XML config.
 
 #. Run the command :option:`traffic_line -x` to apply the configuration

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9236bb73/doc/reference/configuration/records.config.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/configuration/records.config.en.rst b/doc/reference/configuration/records.config.en.rst
index d4b0fba..2c7267b 100644
--- a/doc/reference/configuration/records.config.en.rst
+++ b/doc/reference/configuration/records.config.en.rst
@@ -2020,7 +2020,7 @@ Logging Configuration
     - ``log_header_ STRING NULL
         The file header text (ex. :ref:`squid log <log-formats-squid-format>`).
 
-    The format can be either ``squid`` (Squid Format), ``common`` (Netscape Common),  ``extended`` (Netscape Extended), 
+    The format can be either ``squid`` (Squid Format), ``common`` (Netscape Common),  ``extended`` (Netscape Extended),
     or  ``extended2`` (Netscape Extended-2).
 
 .. ts:cv:: CONFIG proxy.config.log.separate_icp_logs INT 0

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9236bb73/proxy/logging/LogConfig.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogConfig.cc b/proxy/logging/LogConfig.cc
index 63189ee..7b59792 100644
--- a/proxy/logging/LogConfig.cc
+++ b/proxy/logging/LogConfig.cc
@@ -447,7 +447,7 @@ LogConfig::init(LogConfig *prev_config)
 
   // ----------------------------------------------------------------------
   Log::error_log = NULL;
-  
+
   if (prev_config) {
     // Transfer objects from previous configuration.
     transfer_objects(prev_config);
@@ -705,14 +705,14 @@ LogConfig::register_config_callbacks()
   static const char *names[] = {
     "proxy.config.log.log_buffer_size", "proxy.config.log.max_secs_per_buffer", "proxy.config.log.max_space_mb_for_logs",
     "proxy.config.log.max_space_mb_for_orphan_logs", "proxy.config.log.max_space_mb_headroom", "proxy.config.log.logfile_perm",
-    "proxy.config.log.hostname", "proxy.config.log.logfile_dir", "proxy.config.log.separate_icp_logs", 
-    "proxy.config.log.separate_host_logs", "proxy.local.log.collation_mode",
-    "proxy.config.log.collation_host", "proxy.config.log.collation_port", "proxy.config.log.collation_host_tagged",
-    "proxy.config.log.collation_secret", "proxy.config.log.collation_retry_sec", "proxy.config.log.collation_max_send_buffers",
-    "proxy.config.log.rolling_enabled", "proxy.config.log.rolling_interval_sec", "proxy.config.log.rolling_offset_hr",
-    "proxy.config.log.rolling_size_mb", "proxy.config.log.auto_delete_rolled_files", "proxy.config.log.custom_logs_enabled",
-    "proxy.config.log.xml_config_file", "proxy.config.log.hosts_config_file", "proxy.config.log.sampling_frequency",
-    "proxy.config.log.file_stat_frequency", "proxy.config.log.space_used_frequency",
+    "proxy.config.log.hostname", "proxy.config.log.logfile_dir", "proxy.config.log.separate_icp_logs",
+    "proxy.config.log.separate_host_logs", "proxy.local.log.collation_mode", "proxy.config.log.collation_host",
+    "proxy.config.log.collation_port", "proxy.config.log.collation_host_tagged", "proxy.config.log.collation_secret",
+    "proxy.config.log.collation_retry_sec", "proxy.config.log.collation_max_send_buffers", "proxy.config.log.rolling_enabled",
+    "proxy.config.log.rolling_interval_sec", "proxy.config.log.rolling_offset_hr", "proxy.config.log.rolling_size_mb",
+    "proxy.config.log.auto_delete_rolled_files", "proxy.config.log.custom_logs_enabled", "proxy.config.log.xml_config_file",
+    "proxy.config.log.hosts_config_file", "proxy.config.log.sampling_frequency", "proxy.config.log.file_stat_frequency",
+    "proxy.config.log.space_used_frequency",
   };
 
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9236bb73/proxy/logging/LogConfig.h
----------------------------------------------------------------------
diff --git a/proxy/logging/LogConfig.h b/proxy/logging/LogConfig.h
index c4310ad..6143d91 100644
--- a/proxy/logging/LogConfig.h
+++ b/proxy/logging/LogConfig.h
@@ -209,7 +209,7 @@ private:
 
   void setup_default_values();
   void setup_collation(LogConfig *prev_config);
-  
+
   LogFilter *split_by_protocol();
   size_t split_by_hostname(LogFilter *reject_protocol);