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

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


The following commit(s) were added to refs/heads/master by this push:
     new 305ceab  CiaB: Rolling log files of traffic server (#3659)
305ceab is described below

commit 305ceab2287b0e2f53d37945814fe24d9533eff3
Author: Shihta Kuan <[email protected]>
AuthorDate: Thu Jun 6 00:21:36 2019 +0800

    CiaB: Rolling log files of traffic server (#3659)
    
    The following files are rotated
    1. /var/log/ort.log
    2. /var/log/trafficserver/traffic.out
---
 infrastructure/cdn-in-a-box/cache/Dockerfile        |  4 ++--
 .../cdn-in-a-box/ort/traffic_ops_ort.logrotate      | 21 +++++++++++++++++++++
 .../profiles/010-ATS_EDGE_TIER_CACHE.json           | 18 ++++++++++++++++++
 .../profiles/020-ATS_MID_TIER_CACHE.json            | 18 ++++++++++++++++++
 4 files changed, 59 insertions(+), 2 deletions(-)

diff --git a/infrastructure/cdn-in-a-box/cache/Dockerfile 
b/infrastructure/cdn-in-a-box/cache/Dockerfile
index 941afc9..937b7e2 100644
--- a/infrastructure/cdn-in-a-box/cache/Dockerfile
+++ b/infrastructure/cdn-in-a-box/cache/Dockerfile
@@ -29,7 +29,7 @@ ADD 
https://ci.trafficserver.apache.org/RPMS/CentOS7/trafficserver-7.1.4-2.el7.x
 ADD 
https://ci.trafficserver.apache.org/RPMS/CentOS7/trafficserver-devel-7.1.4-2.el7.x86_64.rpm
 /trafficserver-devel.rpm
 
 RUN yum install -y bind-utils kyotocabinet-libs epel-release initscripts 
iproute net-tools nmap-ncat gettext autoconf automake libtool gcc-c++ cronie 
glibc-devel openssl-devel
-RUN yum install -y /trafficserver.rpm /trafficserver-devel.rpm jq 
python36-psutil python36-typing python36-setuptools python36-pip && yum clean 
all
+RUN yum install -y /trafficserver.rpm /trafficserver-devel.rpm jq 
python36-psutil python36-typing python36-setuptools python36-pip logrotate && 
yum clean all
 RUN pip3 install --upgrade pip && pip3 install requests urllib3 distro
 
 ADD traffic_server/plugins/astats_over_http/astats_over_http.c 
traffic_server/plugins/astats_over_http/Makefile.am /
@@ -53,7 +53,7 @@ ADD traffic_control/clients/python /opt/Apache-TrafficControl/
 
 WORKDIR /opt
 
-RUN touch /var/log/ort.log && pip3 install ./Apache-TrafficControl && pip3 
install ./ort && cp ort/traffic_ops_ort.crontab 
/etc/cron.d/traffic_ops_ort-cron-template && mkdir -p /opt/init.d
+RUN touch /var/log/ort.log && pip3 install ./Apache-TrafficControl && pip3 
install ./ort && cp ort/traffic_ops_ort.crontab 
/etc/cron.d/traffic_ops_ort-cron-template && mkdir -p /opt/init.d && cp 
ort/traffic_ops_ort.logrotate /etc/logrotate.d/ort
 
 ADD infrastructure/cdn-in-a-box/cache/run.sh 
infrastructure/cdn-in-a-box/traffic_ops/to-access.sh 
infrastructure/cdn-in-a-box/enroller/server_template.json /
 CMD /run.sh
diff --git a/infrastructure/cdn-in-a-box/ort/traffic_ops_ort.logrotate 
b/infrastructure/cdn-in-a-box/ort/traffic_ops_ort.logrotate
new file mode 100644
index 0000000..7ab712a
--- /dev/null
+++ b/infrastructure/cdn-in-a-box/ort/traffic_ops_ort.logrotate
@@ -0,0 +1,21 @@
+# 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.
+/var/log/ort.log {
+  daily
+  size 50M
+  rotate 1
+}
diff --git 
a/infrastructure/cdn-in-a-box/traffic_ops_data/profiles/010-ATS_EDGE_TIER_CACHE.json
 
b/infrastructure/cdn-in-a-box/traffic_ops_data/profiles/010-ATS_EDGE_TIER_CACHE.json
index 66a3405..d7116b9 100644
--- 
a/infrastructure/cdn-in-a-box/traffic_ops_data/profiles/010-ATS_EDGE_TIER_CACHE.json
+++ 
b/infrastructure/cdn-in-a-box/traffic_ops_data/profiles/010-ATS_EDGE_TIER_CACHE.json
@@ -108,6 +108,24 @@
                        "value": "INT 10000"
                },
                {
+                       "configFile": "records.config",
+                       "name": "CONFIG 
proxy.config.output.logfile.rolling_enabled",
+                       "secure": false,
+                       "value": "INT 2"
+               },
+               {
+                       "configFile": "records.config",
+                       "name": "CONFIG 
proxy.config.output.logfile.rolling_size_mb",
+                       "secure": false,
+                       "value": "INT 500"
+               },
+               {
+                       "configFile": "records.config",
+                       "name": "CONFIG 
proxy.config.output.logfile.rolling_min_count",
+                       "secure": false,
+                       "value": "INT 2"
+               },
+               {
                        "configFile": "cache.config",
                        "name": "location",
                        "secure": false,
diff --git 
a/infrastructure/cdn-in-a-box/traffic_ops_data/profiles/020-ATS_MID_TIER_CACHE.json
 
b/infrastructure/cdn-in-a-box/traffic_ops_data/profiles/020-ATS_MID_TIER_CACHE.json
index 8fd4de2..d464827 100644
--- 
a/infrastructure/cdn-in-a-box/traffic_ops_data/profiles/020-ATS_MID_TIER_CACHE.json
+++ 
b/infrastructure/cdn-in-a-box/traffic_ops_data/profiles/020-ATS_MID_TIER_CACHE.json
@@ -108,6 +108,24 @@
                        "value": "INT 10000"
                },
                {
+                       "configFile": "records.config",
+                       "name": "CONFIG 
proxy.config.output.logfile.rolling_enabled",
+                       "secure": false,
+                       "value": "INT 2"
+               },
+               {
+                       "configFile": "records.config",
+                       "name": "CONFIG 
proxy.config.output.logfile.rolling_size_mb",
+                       "secure": false,
+                       "value": "INT 500"
+               },
+               {
+                       "configFile": "records.config",
+                       "name": "CONFIG 
proxy.config.output.logfile.rolling_min_count",
+                       "secure": false,
+                       "value": "INT 2"
+               },
+               {
                        "configFile": "cache.config",
                        "name": "location",
                        "secure": false,

Reply via email to