From f449e50210b2fc179daefe52808d226f8d710838 Mon Sep 17 00:00:00 2001 From: Zach Hoffman Date: Mon, 15 Apr 2024 10:33:25 -0600 Subject: [PATCH] Store logs in /var/log (#7979) * Store Traffic Router logs in /var/log/traffic_router * Store Tomcat logs in /var/log/tomcat * Store Traffic Monitor logs in /var/log * Store Traffic Stats logs in /var/log/traffic_stats * chore: fix tomcat log path (#121) * Add path separator --------- Co-authored-by: The Anh Nguyen --- CHANGELOG.md | 1 + docs/source/admin/traffic_monitor.rst | 2 +- docs/source/admin/traffic_router.rst | 4 ++-- docs/source/development/debugging.rst | 18 +++++++++--------- .../roles/traffic-monitor/defaults/main.yml | 2 +- .../roles/traffic-router/defaults/main.yml | 4 ++-- .../files/traffic_router.logrotate | 6 +++--- .../roles/traffic_stats/defaults/main.yml | 2 +- .../profiles/040-TRAFFIC_ROUTER.json | 2 +- .../cdn-in-a-box/traffic_router/run.sh | 4 ++-- .../cdn-in-a-box/traffic_stats/run.sh | 6 +++--- .../build/traffic_monitor.logrotate | 6 +++--- traffic_monitor/build/traffic_monitor.spec | 4 ++-- traffic_monitor/conf/traffic_monitor.cfg | 8 ++++---- .../tests/_integration/tm/Dockerfile_run.sh | 12 ++++++------ traffic_router/build/pom.xml | 2 +- traffic_router/core/src/main/conf/log4j2.xml | 4 ++-- .../core/src/main/conf/logging.properties | 2 +- .../core/src/main/lib/logrotate/traffic_router | 6 +++--- .../lib/systemd/system/traffic_router.service | 2 +- traffic_router/core/src/test/conf/log4j2.xml | 8 ++++---- traffic_stats/build/traffic_stats.spec | 5 ++--- traffic_stats/traffic_stats.init | 2 +- traffic_stats/traffic_stats.logrotate | 2 +- traffic_stats/traffic_stats_seelog.xml | 2 +- 25 files changed, 58 insertions(+), 58 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ce4004fa1..de8774b96a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - [#7832](https://github.com/apache/trafficcontrol/pull/7832) *t3c* Removed perl dependency - Updated the CacheGroups Traffic Portal page to use a more performant AG-Grid-based table. - Updated Go version to 1.22.0 +- [#7979](https://github.com/apache/trafficcontrol/pull/7979) *Traffic Router*, *Traffic Monitor*, *Traffic Stats*: Store logs in /var/log ### Fixed - [#7984](https://github.com/apache/trafficcontrol/pull/7984) *Traffic Ops* Fixed TO Client cert authentication with respect to returning response cookie. diff --git a/docs/source/admin/traffic_monitor.rst b/docs/source/admin/traffic_monitor.rst index cd370c35e9..36ed1df1a7 100644 --- a/docs/source/admin/traffic_monitor.rst +++ b/docs/source/admin/traffic_monitor.rst @@ -175,7 +175,7 @@ However newer versions of astats also support CSV output, which can have some CP Troubleshooting and Log Files ============================= -Traffic Monitor log files are in :file:`/opt/traffic_monitor/var/log/`. +Traffic Monitor log files are in :file:`/var/log/traffic_monitor`. .. _admin-tm-extensions: diff --git a/docs/source/admin/traffic_router.rst b/docs/source/admin/traffic_router.rst index 3d6aeb16f3..f03241d099 100644 --- a/docs/source/admin/traffic_router.rst +++ b/docs/source/admin/traffic_router.rst @@ -447,14 +447,14 @@ The following is an example of the request flow when a client requests the routi Troubleshooting and log files ============================= -Traffic Router log files can be found under :file:`/opt/traffic_router/var/log` and :file:`/opt/tomcat/logs`. Initialization and shutdown logs are in :file:`/opt/tomcat/logs/catalina{date}.out`. Application related logging is in :file:`/opt/traffic_router/var/log/traffic_router.log`, while access logs are written to :file:`/opt/traffic_router/var/log/access.log`. +Traffic Router log files can be found under :file:`/var/log/traffic_router` and :file:`/var/log/tomcat`. Initialization and shutdown logs are in :file:`/var/log/tomcat/catalina{date}.out`. Application related logging is in :file:`/var/log/traffic_router/traffic_router.log`, while access logs are written to :file:`/var/log/traffic_route/raccess.log`. Event Log File Format --------------------- Summary """"""" -All access events to Traffic Router are logged to the file :file:`/opt/traffic_router/var/log/access.log`. This file grows up to 200MB and gets rolled into older log files, ten log files total are kept (total of up to 2GB of logged events per Traffic Router instance) +All access events to Traffic Router are logged to the file :file:`/var/log/traffic_router/access.log`. This file grows up to 200MB and gets rolled into older log files, ten log files total are kept (total of up to 2GB of logged events per Traffic Router instance) Traffic Router logs access events in a format that largely follows :abbr:`ATS (Apache Traffic Service)` `event logging format `_. diff --git a/docs/source/development/debugging.rst b/docs/source/development/debugging.rst index ffb7b9308b..9fce5a8cb9 100644 --- a/docs/source/development/debugging.rst +++ b/docs/source/development/debugging.rst @@ -447,27 +447,27 @@ Traffic Router Waiting for Traffic Monitor to start... Waiting for Traffic Monitor to start... Waiting for Traffic Monitor to start... - tail: cannot open '/opt/tomcat/logs/catalina.log' for reading: No such file or directory - tail: cannot open '/opt/tomcat/logs/catalina.2020-02-21.log' for reading: No such file or directory - ==> /opt/traffic_router/var/log/traffic_router.log <== + tail: cannot open '/var/log/tomcat/catalina.log' for reading: No such file or directory + tail: cannot open '/var/log/tomcat/catalina.2020-02-21.log' for reading: No such file or directory + ==> /var/log/traffic_router/traffic_router.log <== - ==> /opt/traffic_router/var/log/access.log <== + ==> /var/log/traffic_routr/access.log <== Tomcat started. - tail: '/opt/tomcat/logs/catalina.log' has appeared; following end of new file - tail: '/opt/tomcat/logs/catalina.2020-02-21.log' has appeared; following end of new file + tail: '/var/log/tomcat/catalina.log' has appeared; following end of new file + tail: '/var/log/tomcat/catalina.2020-02-21.log' has appeared; following end of new file - ==> /opt/traffic_router/var/log/traffic_router.log <== + ==> /var/log/traffic_router/traffic_router.log <== INFO 2020-02-21T05:16:07.557 [Thread-3] org.apache.traffic_control.traffic_router.protocol.LanguidPoller - Waiting for state from mbean path traffic-router:name=languidState INFO 2020-02-21T05:16:07.557 [Thread-4] org.apache.traffic_control.traffic_router.protocol.LanguidPoller - Waiting for state from mbean path traffic-router:name=languidState INFO 2020-02-21T05:16:07.558 [Thread-5] org.apache.traffic_control.traffic_router.protocol.LanguidPoller - Waiting for state from mbean path traffic-router:name=languidState INFO 2020-02-21T05:16:07.559 [Thread-6] org.apache.traffic_control.traffic_router.protocol.LanguidPoller - Waiting for state from mbean path traffic-router:name=languidState - ==> /opt/tomcat/logs/catalina.log <== + ==> /var/log/tomcat/catalina.log <== Listening for transport dt_socket at address: 5005 Watch for the line that mentions port 5005 -----------^^^^ - ==> /opt/tomcat/logs/catalina.2020-02-21.log <== + ==> /var/log/tomcat/catalina.2020-02-21.log <== 21-Feb-2020 05:16:07.359 WARNING [main] org.apache.traffic_control.traffic_router.protocol.LanguidNioProtocol. Adding BouncyCastle provider 21-Feb-2020 05:16:07.452 WARNING [main] org.apache.traffic_control.traffic_router.protocol.LanguidNioProtocol. Serving wildcard certs for multiple domains 21-Feb-2020 05:16:07.459 WARNING [main] org.apache.traffic_control.traffic_router.protocol.LanguidNioProtocol. Serving wildcard certs for multiple domains diff --git a/infrastructure/ansible/roles/traffic-monitor/defaults/main.yml b/infrastructure/ansible/roles/traffic-monitor/defaults/main.yml index f6bb4b9eea..9b6071d019 100644 --- a/infrastructure/ansible/roles/traffic-monitor/defaults/main.yml +++ b/infrastructure/ansible/roles/traffic-monitor/defaults/main.yml @@ -17,7 +17,7 @@ tm_pkg_name: "{% if tm_version is defined and tm_version != omit %}{{ 'traffic_m # Traffic Monitor installation information tm_base_dir: '/opt/traffic_monitor' -tm_log_dir: "{{ tm_base_dir}}/var/log" +tm_log_dir: '/var/log/traffic_monitor' tm_exec_path: "{{ tm_base_dir}}/bin/traffic_monitor" tm_to_config: "{{ tm_base_dir}}/conf/traffic_ops.cfg" tm_config: "{{ tm_base_dir}}/conf/traffic_monitor.cfg" diff --git a/infrastructure/ansible/roles/traffic-router/defaults/main.yml b/infrastructure/ansible/roles/traffic-router/defaults/main.yml index dfd6fb866d..42237f0605 100644 --- a/infrastructure/ansible/roles/traffic-router/defaults/main.yml +++ b/infrastructure/ansible/roles/traffic-router/defaults/main.yml @@ -20,10 +20,10 @@ tomcat_pkg_name: "{% if tr_version is defined and tr_version != omit %}tomcat-{{ tr_base_dir: '/opt/traffic_router' tr_conf_dir: "{{ tr_base_dir }}/conf" tr_temp_dir: "{{ tr_base_dir }}/temp" -tr_log_dir: "{{ tr_base_dir }}/var/log" +tr_log_dir: "/var/log/traffic_router" tr_db_dir: "{{ tr_base_dir }}/db" tr_tomcat_base_dir: '/opt/tomcat' -tr_tomcat_logs_dir: "{{ tr_tomcat_base_dir }}/logs" +tr_tomcat_logs_dir: "/var/log/tomcat" # JAVA_HOME to use in order to specify the desired JRE tr_java_home_dir: '/usr/lib/jvm/jre-11-openjdk' diff --git a/infrastructure/ansible/roles/traffic-router/files/traffic_router.logrotate b/infrastructure/ansible/roles/traffic-router/files/traffic_router.logrotate index d0493ee6a1..0e5f6e0251 100644 --- a/infrastructure/ansible/roles/traffic-router/files/traffic_router.logrotate +++ b/infrastructure/ansible/roles/traffic-router/files/traffic_router.logrotate @@ -16,7 +16,7 @@ # under the License. -/opt/traffic_router/var/log/access.log { +/var/log/traffic_router/access.log { daily size 100m compress @@ -25,11 +25,11 @@ copytruncate } -/opt/traffic_router/var/log/traffic_router.log { +/var/log/traffic_router/traffic_router.log { daily size 100m compress rotate 7 dateformat -%d%m%Y copytruncate -} \ No newline at end of file +} diff --git a/infrastructure/ansible/roles/traffic_stats/defaults/main.yml b/infrastructure/ansible/roles/traffic_stats/defaults/main.yml index 7f7eff66b4..79524aca5d 100644 --- a/infrastructure/ansible/roles/traffic_stats/defaults/main.yml +++ b/infrastructure/ansible/roles/traffic_stats/defaults/main.yml @@ -22,7 +22,7 @@ ts_group: traffic_stats # Traffic Stats Installation information ts_install_basedir: /opt/traffic_stats ts_install_confdir: "{{ ts_install_basedir }}/conf" -ts_install_logdir: "{{ ts_install_basedir }}/var/log/traffic_stats" +ts_install_logdir: "/var/log/traffic_stats" # Traffic Ops connection data ts_toUser: diff --git a/infrastructure/cdn-in-a-box/traffic_ops_data/profiles/040-TRAFFIC_ROUTER.json b/infrastructure/cdn-in-a-box/traffic_ops_data/profiles/040-TRAFFIC_ROUTER.json index 8d869ae41e..3f26a79a8a 100644 --- a/infrastructure/cdn-in-a-box/traffic_ops_data/profiles/040-TRAFFIC_ROUTER.json +++ b/infrastructure/cdn-in-a-box/traffic_ops_data/profiles/040-TRAFFIC_ROUTER.json @@ -7,7 +7,7 @@ "params": [ { "configFile": "inputs.conf", - "name": "monitor:///opt/tomcat/logs/access.log", + "name": "monitor:///var/log/tomcat/access.log", "value": "index=index_odol_test;sourcetype=access_ccr" }, { diff --git a/infrastructure/cdn-in-a-box/traffic_router/run.sh b/infrastructure/cdn-in-a-box/traffic_router/run.sh index 642c2412e9..f2f396449e 100755 --- a/infrastructure/cdn-in-a-box/traffic_router/run.sh +++ b/infrastructure/cdn-in-a-box/traffic_router/run.sh @@ -62,8 +62,8 @@ JAVA_OPTS="\ TO_PROPERTIES="$CATALINA_BASE/conf/traffic_ops.properties" TM_PROPERTIES="$CATALINA_BASE/conf/traffic_monitor.properties" -LOGFILE="$CATALINA_BASE/var/log/traffic_router.log" -ACCESSLOG="$CATALINA_BASE/var/log/access.log" +LOGFILE="/var/log/traffic_router/traffic_router.log" +ACCESSLOG="/var/log/traffic_router/access.log" export JAVA_HOME JAVA_OPTS export TO_PROPERTIES TM_PROPERTIES diff --git a/infrastructure/cdn-in-a-box/traffic_stats/run.sh b/infrastructure/cdn-in-a-box/traffic_stats/run.sh index 2b68d95744..be99ce94f3 100755 --- a/infrastructure/cdn-in-a-box/traffic_stats/run.sh +++ b/infrastructure/cdn-in-a-box/traffic_stats/run.sh @@ -95,12 +95,12 @@ cat <<-EOF >/opt/traffic_stats/conf/traffic_stats_seelog.xml - + EOF -touch /opt/traffic_stats/var/log/traffic_stats/traffic_stats.log +touch /var/log/traffic_stats/traffic_stats.log # Wait for influxdb until nc $INFLUXDB_HOST $INFLUXDB_PORT /dev/null 2>&1; do @@ -124,5 +124,5 @@ else "${traffic_stats_command[@]}" & fi; -exec tail -f /opt/traffic_stats/var/log/traffic_stats/traffic_stats.log +exec tail -f /var/log/traffic_stats/traffic_stats.log diff --git a/traffic_monitor/build/traffic_monitor.logrotate b/traffic_monitor/build/traffic_monitor.logrotate index ae3ca3f276..e15215c556 100644 --- a/traffic_monitor/build/traffic_monitor.logrotate +++ b/traffic_monitor/build/traffic_monitor.logrotate @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -/opt/traffic_monitor/var/log/traffic_monitor.log { +/var/log/traffic_monitor/traffic_monitor.log { compress maxage 30 missingok @@ -25,7 +25,7 @@ copytruncate } -/opt/traffic_monitor/var/log/event.log { +/var/log/traffic_monitor/event.log { compress maxage 30 missingok @@ -35,7 +35,7 @@ copytruncate } -/opt/traffic_monitor/var/log/access.log { +/var/log/traffic_monitor/access.log { compress maxage 30 missingok diff --git a/traffic_monitor/build/traffic_monitor.spec b/traffic_monitor/build/traffic_monitor.spec index 481efc1d11..f29ec7300d 100644 --- a/traffic_monitor/build/traffic_monitor.spec +++ b/traffic_monitor/build/traffic_monitor.spec @@ -48,7 +48,7 @@ mkdir -p "${RPM_BUILD_ROOT}"/opt/traffic_monitor/conf mkdir -p "${RPM_BUILD_ROOT}"/opt/traffic_monitor/backup mkdir -p "${RPM_BUILD_ROOT}"/opt/traffic_monitor/static mkdir -p "${RPM_BUILD_ROOT}"/opt/traffic_monitor/var/run -mkdir -p "${RPM_BUILD_ROOT}"/opt/traffic_monitor/var/log +mkdir -p "${RPM_BUILD_ROOT}"/var/log/traffic_monitor mkdir -p "${RPM_BUILD_ROOT}"/etc/init.d mkdir -p "${RPM_BUILD_ROOT}"/etc/logrotate.d @@ -108,7 +108,7 @@ fi %dir /opt/traffic_monitor/backup %dir /opt/traffic_monitor/static %dir /opt/traffic_monitor/var -%dir /opt/traffic_monitor/var/log +%dir /var/log/traffic_monitor %dir /opt/traffic_monitor/var/run %attr(600, traffic_monitor, traffic_monitor) /opt/traffic_monitor/static/index.html diff --git a/traffic_monitor/conf/traffic_monitor.cfg b/traffic_monitor/conf/traffic_monitor.cfg index 6590c69955..941493d9dc 100644 --- a/traffic_monitor/conf/traffic_monitor.cfg +++ b/traffic_monitor/conf/traffic_monitor.cfg @@ -7,10 +7,10 @@ "distributed_polling": false, "health_flush_interval_ms": 20, "stat_flush_interval_ms": 20, - "log_location_access": "/opt/traffic_monitor/var/log/access.log", - "log_location_event": "/opt/traffic_monitor/var/log/event.log", - "log_location_error": "/opt/traffic_monitor/var/log/traffic_monitor.log", - "log_location_warning": "/opt/traffic_monitor/var/log/traffic_monitor.log", + "log_location_access": "/var/log/traffic_monitor/access.log", + "log_location_event": "/var/log/traffic_monitor/event.log", + "log_location_error": "/var/log/traffic_monitor/traffic_monitor.log", + "log_location_warning": "/var/log/traffic_monitor/traffic_monitor.log", "log_location_info": "null", "log_location_debug": "null", "serve_read_timeout_ms": 10000, diff --git a/traffic_monitor/tests/_integration/tm/Dockerfile_run.sh b/traffic_monitor/tests/_integration/tm/Dockerfile_run.sh index 295a9ac704..eb155d6c89 100755 --- a/traffic_monitor/tests/_integration/tm/Dockerfile_run.sh +++ b/traffic_monitor/tests/_integration/tm/Dockerfile_run.sh @@ -31,8 +31,8 @@ done start() { service traffic_monitor start - touch /opt/traffic_monitor/var/log/traffic_monitor.log - exec tail -f /opt/traffic_monitor/var/log/traffic_monitor.log + touch /var/log/traffic_monitor/traffic_monitor.log + exec tail -f /var/log/traffic_monitor/traffic_monitor.log } init() { @@ -44,10 +44,10 @@ init() { "max_events": 200, "health_flush_interval_ms": 20, "stat_flush_interval_ms": 20, - "log_location_access": "/opt/traffic_monitor/var/log/access.log", - "log_location_event": "/opt/traffic_monitor/var/log/event.log", - "log_location_error": "/opt/traffic_monitor/var/log/traffic_monitor.log", - "log_location_warning": "/opt/traffic_monitor/var/log/traffic_monitor.log", + "log_location_access": "/var/log/traffic_monitor/access.log", + "log_location_event": "/var/log/traffic_monitor/event.log", + "log_location_error": "/var/log/traffic_monitor/traffic_monitor.log", + "log_location_warning": "/var/log/traffic_monitor/traffic_monitor.log", "log_location_info": "null", "log_location_debug": "null", "serve_read_timeout_ms": 10000, diff --git a/traffic_router/build/pom.xml b/traffic_router/build/pom.xml index af03c93ca4..8f1132a565 100644 --- a/traffic_router/build/pom.xml +++ b/traffic_router/build/pom.xml @@ -162,7 +162,7 @@ - ${deploy.dir}/var/log + /var/log/traffic_router 755 root root diff --git a/traffic_router/core/src/main/conf/log4j2.xml b/traffic_router/core/src/main/conf/log4j2.xml index 760eefdff7..1b71807916 100644 --- a/traffic_router/core/src/main/conf/log4j2.xml +++ b/traffic_router/core/src/main/conf/log4j2.xml @@ -19,11 +19,11 @@ - + - + diff --git a/traffic_router/core/src/main/conf/logging.properties b/traffic_router/core/src/main/conf/logging.properties index bf66cb29ae..b506e4e701 100644 --- a/traffic_router/core/src/main/conf/logging.properties +++ b/traffic_router/core/src/main/conf/logging.properties @@ -23,7 +23,7 @@ handlers = 1catalina.org.apache.juli.AsyncFileHandler, 2localhost.org.apache.jul ############################################################ 1catalina.org.apache.juli.AsyncFileHandler.level = INFO -1catalina.org.apache.juli.AsyncFileHandler.directory = ${catalina.home}/logs +1catalina.org.apache.juli.AsyncFileHandler.directory = /var/log/tomcat 1catalina.org.apache.juli.AsyncFileHandler.prefix = catalina. 1catalina.org.apache.juli.AsyncFileHandler.rotatable = true 1catalina.org.apache.juli.AsyncFileHandler.maxDays = 30 diff --git a/traffic_router/core/src/main/lib/logrotate/traffic_router b/traffic_router/core/src/main/lib/logrotate/traffic_router index a8709c14a2..abdfde262a 100644 --- a/traffic_router/core/src/main/lib/logrotate/traffic_router +++ b/traffic_router/core/src/main/lib/logrotate/traffic_router @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -/opt/traffic_router/var/log/access.log { +/var/log/traffic_router/access.log { daily size 1k compress @@ -24,11 +24,11 @@ copytruncate } -/opt/traffic_router/var/log/traffic_router.log { +/var/log/traffic_router/traffic_router.log { daily size 1k compress rotate 7 dateformat -%d%m%Y copytruncate -} \ No newline at end of file +} diff --git a/traffic_router/core/src/main/lib/systemd/system/traffic_router.service b/traffic_router/core/src/main/lib/systemd/system/traffic_router.service index de5ebf1395..0a9d23f63e 100644 --- a/traffic_router/core/src/main/lib/systemd/system/traffic_router.service +++ b/traffic_router/core/src/main/lib/systemd/system/traffic_router.service @@ -23,7 +23,7 @@ Environment=JAVA_HOME=/usr/lib/jvm/jre-11-openjdk Environment=CATALINA_PID=/opt/traffic_router/temp/tomcat.pid Environment=CATALINA_HOME=/opt/tomcat Environment=CATALINA_BASE=/opt/traffic_router -Environment=CATALINA_OUT=/opt/tomcat/logs/catalina.log +Environment=CATALINA_OUT=/var/log/tomcat/catalina.log EnvironmentFile=/opt/traffic_router/conf/startup.properties ExecStartPre=/bin/bash /opt/traffic_router/conf/generatingCerts.sh ExecStart=/opt/tomcat/bin/startup.sh diff --git a/traffic_router/core/src/test/conf/log4j2.xml b/traffic_router/core/src/test/conf/log4j2.xml index 5984d9d0e4..ec41b3abf6 100644 --- a/traffic_router/core/src/test/conf/log4j2.xml +++ b/traffic_router/core/src/test/conf/log4j2.xml @@ -19,8 +19,8 @@ + fileName="/var/log/traffic_router/access.log" + filePattern="/var/log/traffic_router/access.log.%i" > @@ -29,8 +29,8 @@ + fileName="/var/log/traffic_router/traffic_router.log" + filePattern="/var/log/traffic_router/traffic_router.log.%i" > diff --git a/traffic_stats/build/traffic_stats.spec b/traffic_stats/build/traffic_stats.spec index e9ace68aeb..e056ec4567 100644 --- a/traffic_stats/build/traffic_stats.spec +++ b/traffic_stats/build/traffic_stats.spec @@ -64,7 +64,7 @@ mkdir -p "${RPM_BUILD_ROOT}"/opt/traffic_stats/conf mkdir -p "${RPM_BUILD_ROOT}"/opt/traffic_stats/backup mkdir -p "${RPM_BUILD_ROOT}"/opt/traffic_stats/influxdb_tools mkdir -p "${RPM_BUILD_ROOT}"/opt/traffic_stats/var/run -mkdir -p "${RPM_BUILD_ROOT}"/opt/traffic_stats/var/log/traffic_stats +mkdir -p "${RPM_BUILD_ROOT}"/var/log/traffic_stats mkdir -p "${RPM_BUILD_ROOT}"/etc/init.d mkdir -p "${RPM_BUILD_ROOT}"/etc/logrotate.d mkdir -p "${RPM_BUILD_ROOT}"/var/lib/grafana/plugins/trafficcontrol-scenes-app @@ -129,9 +129,8 @@ fi %dir /opt/traffic_stats/conf %dir /opt/traffic_stats/backup %dir /opt/traffic_stats/var -%dir /opt/traffic_stats/var/log %dir /opt/traffic_stats/var/run -%dir /opt/traffic_stats/var/log/traffic_stats +%dir /var/log/traffic_stats %dir /var/lib/grafana/plugins/trafficcontrol-scenes-app %dir /opt/traffic_stats/influxdb_tools diff --git a/traffic_stats/traffic_stats.init b/traffic_stats/traffic_stats.init index 3adf06d8cd..67e8b54378 100644 --- a/traffic_stats/traffic_stats.init +++ b/traffic_stats/traffic_stats.init @@ -63,7 +63,7 @@ start() { # Start daemons. echo -n $"Starting $name: " - daemon nohup $prog $options < /dev/null > /opt/traffic_stats/var/log/traffic_stats/traffic_stats.out 2>&1 & + daemon nohup $prog $options < /dev/null > /var/log/traffic_stats/traffic_stats.out 2>&1 & RETVAL=$? echo [ $RETVAL -eq 0 ] && touch $lockfile diff --git a/traffic_stats/traffic_stats.logrotate b/traffic_stats/traffic_stats.logrotate index ef1bb9c978..be3bd7a10c 100644 --- a/traffic_stats/traffic_stats.logrotate +++ b/traffic_stats/traffic_stats.logrotate @@ -16,7 +16,7 @@ # specific language governing permissions and limitations # under the License. -/opt/traffic_stats/var/log/traffic_stats/traffic_stats.log { +/var/log/traffic_stats/traffic_stats.log { compress maxage 30 missingok diff --git a/traffic_stats/traffic_stats_seelog.xml b/traffic_stats/traffic_stats_seelog.xml index 301016a733..7463dc298b 100644 --- a/traffic_stats/traffic_stats_seelog.xml +++ b/traffic_stats/traffic_stats_seelog.xml @@ -20,6 +20,6 @@ under the License. - +