You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bc...@apache.org on 2018/09/20 16:57:41 UTC

[trafficserver] branch master updated: Use the default log rotation enabled value and remove old comments in logging.yaml and link to docs

This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 74f6b40  Use the default log rotation enabled value and remove old comments in logging.yaml and link to docs
74f6b40 is described below

commit 74f6b40f844e6c5a9f2179756ae5fa8003527105
Author: Bryan Call <bc...@apache.org>
AuthorDate: Wed Sep 19 16:40:07 2018 -0700

    Use the default log rotation enabled value and remove old comments in
    logging.yaml and link to docs
---
 configs/logging.yaml.default   | 60 +++++-------------------------------------
 proxy/logging/YamlLogConfig.cc |  2 +-
 2 files changed, 8 insertions(+), 54 deletions(-)

diff --git a/configs/logging.yaml.default b/configs/logging.yaml.default
index 7f9c26f..ea593ee 100644
--- a/configs/logging.yaml.default
+++ b/configs/logging.yaml.default
@@ -1,60 +1,14 @@
-# Custom log configuration.
-
-# The log.* functions accept a table that supports the following fields:
-#    Filename (string, required):
-#    Format (string or format object, required):
-#    Header (string, optional):
-#    RollingEnabled (boolean, optional):
-#    RollingIntervalSec (number, optional):
-#    RollingOffsetHr (number, optional):
-#    RollingSizeMb (number, optional):
-#    Filters (array of filter objects, optional):
-#    CollationHosts (array of strings, optional):
-#      This parameter may be either a single string or an array of entries.
-#      Entries may be strings or arrays of strings. A string specifies a
-#      single collation host, which is equivalent to providing an array
-#      containing a single string.
-#
-#      If multiple entries are given, multiple collation hosts are configured
-#      and each log entry will be forwarded to every host.
-#
-#      If an entry is an array of strings, this defines a collation host
-#      failover group. The first array entry is the primary collation host
-#      and the remaining entries are attached as ordered failover hosts
-#      that will be attempted if the primary host fails.
+# Custom log configuration
 #
-#      A single collation host with failover:
-#        { {'logs-1.example.com:4567', 'logs-2.example.com:4567'} }
+# Documentation on logging:
+#    https://docs.trafficserver.apache.org/en/8.0.x/admin-guide/logging/index.en.html
 #
-#      Multiple collation hosts:
-#        {'logs-1.example.com:4567', 'logs-2.example.com:4567'}
+# Documentaion on logging.yaml file format:
+#    https://docs.trafficserver.apache.org/en/8.0.x/admin-guide/files/logging.yaml.en.html
 #
-#      Multiple collation hosts with some failover:
-#        {'logs-1.example.com:4567', { 'logs-2.example.com:4567', 'logs-2a.example.com:4567'} }
+# Example log configurations:
+#    https://docs.trafficserver.apache.org/en/8.0.x/admin-guide/logging/examples.en.html
 
-# Predefined variables.
-#
-# log.roll.none (number)
-#  RollingEnabled value to disable all log rolling.
-#
-# log.roll.time (number)
-#  RollingEnabled value. Roll at a certain time frequency, specified
-#  by RollingIntervalSec, and RollingOffsetHr.
-#
-# log.roll.size (number)
-#  RollingEnabled value. Roll when the size exceeds RollingSizeMb.
-#
-# log.roll.both (number)
-#  RollingEnabled value. Roll when either the specified rolling
-#  time is reached or the specified file size is reached.
-#
-# log.roll.any (number)
-#  RollingEnabled value. Roll the log file when the specified
-#  rolling time is reached if the size of the file equals or exceeds
-#  the specified size.
-#
-# log.protocol.http (number)
-#  Server protocol constants for constructing %<etype> filters.
 
 formats:
     # WebTrends Enhanced Log Format.
diff --git a/proxy/logging/YamlLogConfig.cc b/proxy/logging/YamlLogConfig.cc
index 9994962..07bfcfb 100644
--- a/proxy/logging/YamlLogConfig.cc
+++ b/proxy/logging/YamlLogConfig.cc
@@ -145,7 +145,7 @@ YamlLogConfig::decodeLogObject(const YAML::Node &node)
                    (0 == strcasecmp(mode.c_str(), "ascii_pipe") ? LOG_FILE_PIPE : LOG_FILE_ASCII));
   }
 
-  int obj_rolling_enabled      = 0;
+  int obj_rolling_enabled      = cfg->rolling_enabled;
   int obj_rolling_interval_sec = cfg->rolling_interval_sec;
   int obj_rolling_offset_hr    = cfg->rolling_offset_hr;
   int obj_rolling_size_mb      = cfg->rolling_size_mb;