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/07/31 03:18:08 UTC
trafficserver git commit: TS-3807: Remove legacy log splitting code
and docs.
Repository: trafficserver
Updated Branches:
refs/heads/master 792a75b1a -> 6d37b7c88
TS-3807: Remove legacy log splitting code and docs.
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/6d37b7c8
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/6d37b7c8
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/6d37b7c8
Branch: refs/heads/master
Commit: 6d37b7c888eae4290c605729783ef1f8d4a384bb
Parents: 792a75b
Author: Phil Sorber <so...@apache.org>
Authored: Thu Jul 30 19:17:43 2015 -0600
Committer: Phil Sorber <so...@apache.org>
Committed: Thu Jul 30 19:17:43 2015 -0600
----------------------------------------------------------------------
doc/admin/working-log-files.en.rst | 13 --
.../LC_MESSAGES/admin/working-log-files.en.po | 8 -
.../configuration/records.config.en.rst | 15 --
lib/perl/lib/Apache/TS/AdminClient.pm | 2 -
mgmt/RecordsConfig.cc | 4 -
proxy/logging/LogConfig.cc | 164 +------------------
proxy/logging/LogConfig.h | 6 +-
tools/traffic_shell.pl | 7 -
8 files changed, 9 insertions(+), 210 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6d37b7c8/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 85f1fd3..ab26d1d 100644
--- a/doc/admin/working-log-files.en.rst
+++ b/doc/admin/working-log-files.en.rst
@@ -637,19 +637,6 @@ Traffic Server also enables you to create XML-based
:ref:`Custom Log Formats <using-custom-log-formats>` that offer even greater
control over log file generation.
-Setting Log Splitting Options
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-To set log splitting options, follow the steps below:
-
-#. In the :file:`records.config` file, edit the following variables
-
- - :ts:cv:`proxy.config.log.separate_icp_logs`
- - :ts:cv:`proxy.config.log.separate_host_logs`
-
-#. Run the command :option:`traffic_line -x` to apply the configuration
- changes.
-
Editing the log_hosts.config File
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6d37b7c8/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 91f3a3c..86754ef 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
@@ -1007,14 +1007,6 @@ msgstr ""
msgid "To set log splitting options, follow the steps below:"
msgstr ""
-#: ../../admin/working-log-files.en.rst:662
-msgid ":ts:cv:`proxy.config.log.separate_icp_logs`"
-msgstr ""
-
-#: ../../admin/working-log-files.en.rst:663
-msgid ":ts:cv:`proxy.config.log.separate_host_logs`"
-msgstr ""
-
#: ../../admin/working-log-files.en.rst:669
msgid "Editing the log_hosts.config File"
msgstr ""
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6d37b7c8/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 0b0a150..257e070 100644
--- a/doc/reference/configuration/records.config.en.rst
+++ b/doc/reference/configuration/records.config.en.rst
@@ -2068,21 +2068,6 @@ Logging Configuration
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:
-
- When enabled (``1``), configures Traffic Server to store ICP transactions in a separate log file.
-
- - ``0`` = separation is disabled, all ICP transactions are recorded in the same file as HTTP transactions
- - ``1`` = all ICP transactions are recorded in a separate log file.
- - ``-1`` = filter all ICP transactions from the default log files; ICP transactions are not logged anywhere.
-
-.. ts:cv:: CONFIG proxy.config.log.separate_host_logs INT 0
- :reloadable:
-
- When enabled (``1``), configures Traffic Server to create a separate log file for HTTP transactions for each origin server listed in the
- :file:`log_hosts.config` file. Refer to :ref:`HTTP Host Log Splitting <httphostlogsplitting>`.
-
.. ts:cv:: LOCAL proxy.local.log.collation_mode INT 0
:reloadable:
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6d37b7c8/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 6940c15..9159e3e 100644
--- a/lib/perl/lib/Apache/TS/AdminClient.pm
+++ b/lib/perl/lib/Apache/TS/AdminClient.pm
@@ -599,8 +599,6 @@ The Apache Traffic Server Administration Manual will explain what these strings
proxy.config.log.rolling_offset_hr
proxy.config.log.rolling_size_mb
proxy.config.log.sampling_frequency
- proxy.config.log.separate_host_logs
- proxy.config.log.separate_icp_logs
proxy.config.log.space_used_frequency
proxy.config.log.xml_config_file
proxy.config.manager_binary
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6d37b7c8/mgmt/RecordsConfig.cc
----------------------------------------------------------------------
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index 74ff03c..72e677f 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -1134,10 +1134,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.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}
- ,
{RECT_CONFIG, "proxy.config.log.collation_host", RECD_STRING, NULL, RECU_DYNAMIC, RR_NULL, RECC_STR, "^[^[:space:]]*$", RECA_NULL}
,
{RECT_CONFIG, "proxy.config.log.collation_port", RECD_INT, "8085", RECU_DYNAMIC, RR_REQUIRED, RECC_INT, "[0-65535]", RECA_NULL}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6d37b7c8/proxy/logging/LogConfig.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogConfig.cc b/proxy/logging/LogConfig.cc
index bb31695..f9b1c0b 100644
--- a/proxy/logging/LogConfig.cc
+++ b/proxy/logging/LogConfig.cc
@@ -81,9 +81,6 @@ LogConfig::setup_default_values()
logfile_perm = 0644;
logfile_dir = ats_strdup(".");
- separate_icp_logs = 1;
- separate_host_logs = false;
-
collation_mode = Log::NO_COLLATION;
collation_host = ats_strdup("none");
collation_port = 0;
@@ -202,32 +199,6 @@ LogConfig::read_configuration_variables()
_exit(1);
}
- //
- // for each predefined logging format, we need to know:
- // - whether logging in that format is enabled
- // - if we're logging to a file, what the name and format (ASCII,
- // BINARY) are
- // - what header should be written down at the start of each file for
- // this format
- // this is accomplished with four config variables per format:
- // "proxy.config.log.<format>_log_enabled" INT
- // "proxy.config.log.<format>_log_is_ascii" INT
- // "proxy.config.log.<format>_log_name" STRING
- // "proxy.config.log.<format>_log_header" STRING
- //
-
- // SPLITTING
- // 0 means no splitting
- // 1 means splitting
- // for icp
- // -1 means filter out (do not log and do not create split file)
- val = (int)REC_ConfigReadInteger("proxy.config.log.separate_icp_logs");
- separate_icp_logs = (val > 0);
-
- val = (int)REC_ConfigReadInteger("proxy.config.log.separate_host_logs");
- separate_host_logs = (val > 0);
-
-
// COLLATION
val = (int)REC_ConfigReadInteger("proxy.local.log.collation_mode");
// do not restrict value so that error message is logged if
@@ -510,8 +481,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, " 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);
fprintf(fd, " collation_host = %s\n", collation_host);
fprintf(fd, " collation_port = %d\n", collation_port);
@@ -539,129 +508,13 @@ LogConfig::display(FILE *fd)
}
//-----------------------------------------------------------------------------
-// split_by_protocol
-//
-// This function creates the objects needed to log different protocols on
-// their own file if any of the "separate_xxx_logs" config. variable is set.
-//
-// Upon return, the pf_list argument holds the filters that reject the
-// protocols for which objects have been created. This filter list is used
-// to create the rest of the pre defined log objects.
-//
-// As input, this function requires a list wilh all information regarding
-// pre-defined formats.
-//
-LogFilter *
-LogConfig::split_by_protocol()
-{
- if (!separate_icp_logs) {
- return NULL;
- }
- // http MUST be last entry
- enum {
- icp = 0,
- http,
- };
-
- int64_t value[] = {LOG_ENTRY_ICP, LOG_ENTRY_HTTP};
- const char *filter_name[] = {"__icp__", "__http__"};
- int64_t filter_val[http]; // protocols to reject
- size_t n = 0;
-
- LogField *etype_field = Log::global_field_list.find_by_symbol("etype");
- ink_assert(etype_field);
-
- if (separate_icp_logs) {
- if (separate_icp_logs == 1) {
- LogFilter *filter[1];
-
- filter[0] = new LogFilterInt(filter_name[icp], etype_field, LogFilter::ACCEPT, LogFilter::MATCH, value[icp]);
- delete filter[0];
- }
- filter_val[n++] = value[icp];
- }
-
- // At this point, separate objects for all protocols except http
- // have been created if requested. We now add to the argument list
- // the filters needed to reject the protocols that have already
- // been taken care of. Note that we do not test for http since
- // there is no "separate_http_logs" config variable and thus http
- // could not have been taken care of at this point
- //
-
- if (n > 0) {
- return new LogFilterInt("__reject_protocols__", etype_field, LogFilter::REJECT, LogFilter::MATCH, n, filter_val);
- }
- return NULL;
-}
-
-size_t
-LogConfig::split_by_hostname(LogFilter *reject_protocol_filter)
-{
- size_t n_hosts;
- char **host = read_log_hosts_file(&n_hosts); // allocates memory for array
-
- if (n_hosts) {
- size_t num_filt = 0;
- LogFilter *rp_ah[2]; // rejected protocols + accepted host
- LogField *shn_field = Log::global_field_list.find_by_symbol("shn");
- ink_assert(shn_field);
-
- if (reject_protocol_filter) {
- rp_ah[num_filt++] = reject_protocol_filter;
- }
-
- for (size_t i = 0; i < n_hosts; ++i) {
- // add a filter that accepts the specified hostname
- //
- char filter_name[LOG_MAX_FORMAT_LINE + 12];
- snprintf(filter_name, LOG_MAX_FORMAT_LINE, "__accept_%s__", host[i]);
- rp_ah[num_filt] =
- new LogFilterString(filter_name, shn_field, LogFilter::ACCEPT, LogFilter::CASE_INSENSITIVE_CONTAIN, host[i]);
-
- delete rp_ah[num_filt];
- }
-
- LogFilter *rp_rh[2]; // rejected protocols + rejected hosts
-
- num_filt = 0;
-
- if (reject_protocol_filter) {
- rp_rh[num_filt++] = reject_protocol_filter;
- }
-
- rp_rh[num_filt] =
- new LogFilterString("__reject_hosts__", shn_field, LogFilter::REJECT, LogFilter::CASE_INSENSITIVE_CONTAIN, n_hosts, host);
-
- // create the "catch-all" object that contains logs for all
- // hosts other than those specified in the hosts file and for
- // those protocols that do not have their own file
- //
-
- delete rp_rh[num_filt];
-
- delete[] host; // deallocate memory allocated by
- // read_log_hosts_file
- }
- // host is not allocated unless n_hosts > 0
- // coverity[leaked_storage]
- return n_hosts;
-}
-
-//-----------------------------------------------------------------------------
// setup_log_objects
//
-// Construct:
-//
-// -All objects necessary to log the pre defined formats considering
-// protocol and host splitting.
-// -All custom objects.
+// Construct: All custom objects.
//
// Upon return from this function:
// - global_object_list has the aforementioned objects
// - 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).
//
void
LogConfig::setup_log_objects()
@@ -719,14 +572,13 @@ 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.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/6d37b7c8/proxy/logging/LogConfig.h
----------------------------------------------------------------------
diff --git a/proxy/logging/LogConfig.h b/proxy/logging/LogConfig.h
index 424bffb..ba533f6 100644
--- a/proxy/logging/LogConfig.h
+++ b/proxy/logging/LogConfig.h
@@ -74,6 +74,7 @@ extern RecRawStatBlock *log_rsb;
struct dirent;
struct LogCollationAccept;
+
/*-------------------------------------------------------------------------
this object keeps the state of the logging configuraion variables. upon
construction, the log configuration file is read and the logging
@@ -176,8 +177,6 @@ public:
int max_space_mb_for_orphan_logs;
int max_space_mb_headroom;
int logfile_perm;
- bool separate_icp_logs;
- bool separate_host_logs;
int collation_mode;
int collation_port;
bool collation_host_tagged;
@@ -210,9 +209,6 @@ private:
void setup_default_values();
void setup_collation(LogConfig *prev_config);
- 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
// of space that logging can use, otherwise use max_space_mb_for_logs
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6d37b7c8/tools/traffic_shell.pl
----------------------------------------------------------------------
diff --git a/tools/traffic_shell.pl b/tools/traffic_shell.pl
index 4a13627..e65ea3f 100755
--- a/tools/traffic_shell.pl
+++ b/tools/traffic_shell.pl
@@ -523,9 +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 $icp_log = get_on_off("proxy.config.log.separate_icp_logs");
- my $http_host_log = get_on_off("proxy.config.log.separate_host_logs");
-
my $custom_log = get_on_off("proxy.config.log.custom_logs_enabled");
my $rolling = get_on_off("proxy.config.log.rolling_enabled");
@@ -548,10 +545,6 @@ Log Collation ---------------------------- $collation_mode
Preproc Threads ------------------------ $preproc_threads
Space Limit for Orphan Files ----------- $orphan_space MB
-Splitting
- ICP Log Splitting ---------------------- $icp_log
- HTTP Host Log Splitting ---------------- $http_host_log
-
Custom Logs ------------------------------ $custom_log
Rolling ---------------------------------- $rolling