From 78a19f7dcc8c73ad8151adeba8fe3a34d22f709b Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sat, 22 May 2021 14:32:36 +0900 Subject: [PATCH] libvirt: fix formatting of the log_outputs parameter Change 3f2e063c7894151df1a40dea6cbee9265b30cdb8 updated format of the log_outputs parameter unpexpectedly, and because of that change libvirt no longer generate its log file by default. This change fixes the parameter format so that libvirt records logs as expected. Closes-Bug: #1929264 Change-Id: Ic92584431e0bf38bf4ae2a2479aa7999b343ae33 (cherry picked from commit 65ddeed5f436a7062f2ff419792b120de2675b74) --- deployment/logging/files/nova-libvirt.yaml | 34 +++++++++++++-------- deployment/logging/stdout/nova-libvirt.yaml | 34 +++++++++++++-------- 2 files changed, 44 insertions(+), 24 deletions(-) diff --git a/deployment/logging/files/nova-libvirt.yaml b/deployment/logging/files/nova-libvirt.yaml index b5b7f5aa39..1796cc6054 100644 --- a/deployment/logging/files/nova-libvirt.yaml +++ b/deployment/logging/files/nova-libvirt.yaml @@ -32,19 +32,29 @@ outputs: description: Extra hieradata needed to log to files in the host. value: nova::compute::libvirt::log_outputs: - if: - - or: - - {get_param: Debug } - - {get_param: LibvirtDebug } - - 1 - - {get_param: LibvirtLogLevel} + str_replace: + template: + 'LEVEL:file:/var/log/libvirt/libvirtd.log' + params: + LEVEL: + if: + - or: + - {get_param: Debug } + - {get_param: LibvirtDebug } + - 1 + - {get_param: LibvirtLogLevel} nova::compute::libvirt::virtlogd::log_outputs: - if: - - or: - - {get_param: Debug } - - {get_param: LibvirtDebug } - - 1 - - {get_param: LibvirtVirtlogdLogLevel} + str_replace: + template: + 'LEVEL:file:/var/log/libvirt/virtlogd.log' + params: + LEVEL: + if: + - or: + - {get_param: Debug } + - {get_param: LibvirtDebug } + - 1 + - {get_param: LibvirtVirtlogdLogLevel} volumes: description: The volumes needed to log to files in the host. value: diff --git a/deployment/logging/stdout/nova-libvirt.yaml b/deployment/logging/stdout/nova-libvirt.yaml index fd02fe4e6a..e12f77a79d 100644 --- a/deployment/logging/stdout/nova-libvirt.yaml +++ b/deployment/logging/stdout/nova-libvirt.yaml @@ -32,19 +32,29 @@ outputs: description: Extra hieradata needed to log to stdout. value: nova::compute::libvirt::log_outputs: - if: - - or: - - {get_param: Debug } - - {get_param: LibvirtDebug } - - 1 - - {get_param: LibvirtLogLevel} + str_replace: + template: + 'LEVEL:stderr' + params: + LEVEL: + if: + - or: + - {get_param: Debug } + - {get_param: LibvirtDebug } + - 1 + - {get_param: LibvirtLogLevel} nova::compute::libvirt::virtlogd::log_outputs: - if: - - or: - - {get_param: Debug } - - {get_param: LibvirtDebug } - - 1 - - {get_param: LibvirtVirtlogdLogLevel} + str_replace: + template: + 'LEVEL:stderr' + params: + LEVEL: + if: + - or: + - {get_param: Debug } + - {get_param: LibvirtDebug } + - 1 + - {get_param: LibvirtVirtlogdLogLevel} docker_config: description: Extra containers needed for logging to stdout or a sidecar container. value: null