From d520016ff827fb309a5935c2c7189bb5a2bc4bf1 Mon Sep 17 00:00:00 2001 From: Victor Pickard Date: Wed, 19 Sep 2018 16:41:55 -0400 Subject: [PATCH] Change log directory for OpenDaylight OpenDaylight karaf logs are currently stored in /var/log/containers/opendaylight/karaf.log. There is a logrotate_crond container job, that will rotate any *.log in /var/log/containers, with this pattern: /var/log/containers/*/*log /var/log/containers/*/*/*log { daily .... } OpenDaylight is Java code, and has it's own logrotate mechanism alreay configured. Currently, we have 2 entities doing log rotation, tripleO logrotate_crond, and ODL Pax logging. These 2 don't play nicely together. This patch will move the ODL logs out of the path of the tripleO log rotate cron job, so that ODL can manage it's own log rotation. Another option would be to modify tripleO to explicitly list out all of the containers, and only do log rotation for those listed. Closes-Bug:#1793566 https://bugs.launchpad.net/tripleo/+bug/1793566 Change-Id: I8acf7db248bf31d3010bc0313f48812a244d1004 Signed-off-by: Victor Pickard --- docker/services/logging/files/opendaylight-api.yaml | 6 +++--- .../fix-odl-karaf-logging-eca10973e57caa3a.yaml | 12 ++++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/fix-odl-karaf-logging-eca10973e57caa3a.yaml diff --git a/docker/services/logging/files/opendaylight-api.yaml b/docker/services/logging/files/opendaylight-api.yaml index a035ebb2e6..d752802905 100644 --- a/docker/services/logging/files/opendaylight-api.yaml +++ b/docker/services/logging/files/opendaylight-api.yaml @@ -13,7 +13,7 @@ outputs: volumes: description: The volumes needed to log to files in the host. value: - - /var/log/containers/opendaylight:/opt/opendaylight/data/log + - /var/log/containers/opendaylight/karaf/logs:/opt/opendaylight/data/log host_prep_tasks: description: Extra ansible tasks needed for logging to files in the host. value: @@ -22,11 +22,11 @@ outputs: path: "{{ item }}" state: directory with_items: - - /var/log/containers/opendaylight + - /var/log/containers/opendaylight/karaf/logs - /var/log/opendaylight - name: opendaylight logs readme copy: dest: /var/log/opendaylight/readme.txt content: | - Logs from OpenDaylight container can be found at /var/log/containers/opendaylight/karaf.log + Logs from OpenDaylight container can be found at /var/log/containers/opendaylight/karaf/logs/karaf.log ignore_errors: true \ No newline at end of file diff --git a/releasenotes/notes/fix-odl-karaf-logging-eca10973e57caa3a.yaml b/releasenotes/notes/fix-odl-karaf-logging-eca10973e57caa3a.yaml new file mode 100644 index 0000000000..17fc672053 --- /dev/null +++ b/releasenotes/notes/fix-odl-karaf-logging-eca10973e57caa3a.yaml @@ -0,0 +1,12 @@ +--- +fixes: + - | + Fixes openDaylight karaf file log rotation by changing + karaf log rollover parameters in PAX logging configuration. + Reference https://git.opendaylight.org/gerrit/#/c/75480/ + for more details. + + Also, moves openDaylight karaf log file location to + /var/log/containers/opendaylight/karaf/logs/karaf.log. + Reference https://review.openstack.org/#/c/603907/ for + more details.