From 339735f25ddb035957f0c2f8a16e3f6aa82f6665 Mon Sep 17 00:00:00 2001 From: ZhongShengping Date: Mon, 15 Jan 2018 15:51:46 +0800 Subject: [PATCH] Add use_journal option for logging configuration This enables oslo.log to pass logging records to journald. Change-Id: I18ec0f9eb40624042dcdb4897b11be56190ddc00 --- manifests/logging.pp | 6 ++++++ ...add-use_journal-option-for-logging-bb188924ad2f8d6c.yaml | 5 +++++ spec/classes/ironic_logging_spec.rb | 3 +++ 3 files changed, 14 insertions(+) create mode 100644 releasenotes/notes/add-use_journal-option-for-logging-bb188924ad2f8d6c.yaml diff --git a/manifests/logging.pp b/manifests/logging.pp index d2621ff8..6c80c931 100644 --- a/manifests/logging.pp +++ b/manifests/logging.pp @@ -16,6 +16,10 @@ # (Optional) Use json for logging. # Defaults to $::os_service_default # +# [*use_journal*] +# (Optional) Use journal for logging. +# Defaults to $::os_service_default +# # [*use_stderr*] # (optional) Use stderr for logging # Defaults to $::os_service_default @@ -92,6 +96,7 @@ class ironic::logging( $use_syslog = $::os_service_default, $use_json = $::os_service_default, + $use_journal = $::os_service_default, $use_stderr = $::os_service_default, $log_facility = $::os_service_default, $log_dir = '/var/log/ironic', @@ -128,6 +133,7 @@ class ironic::logging( use_stderr => $use_stderr_real, use_syslog => $use_syslog_real, use_json => $use_json, + use_journal => $use_journal, log_dir => $log_dir_real, syslog_log_facility => $log_facility_real, logging_context_format_string => $logging_context_format_string, diff --git a/releasenotes/notes/add-use_journal-option-for-logging-bb188924ad2f8d6c.yaml b/releasenotes/notes/add-use_journal-option-for-logging-bb188924ad2f8d6c.yaml new file mode 100644 index 00000000..12b190e7 --- /dev/null +++ b/releasenotes/notes/add-use_journal-option-for-logging-bb188924ad2f8d6c.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Adds the use_journal option for configuring oslo.log. This will enable + passing the logs to journald. diff --git a/spec/classes/ironic_logging_spec.rb b/spec/classes/ironic_logging_spec.rb index 28ba64ff..ab92d3d4 100644 --- a/spec/classes/ironic_logging_spec.rb +++ b/spec/classes/ironic_logging_spec.rb @@ -25,6 +25,7 @@ describe 'ironic::logging' do :log_date_format => '%Y-%m-%d %H:%M:%S', :use_syslog => true, :use_json => true, + :use_journal => true, :use_stderr => false, :log_facility => 'LOG_FOO', :log_dir => '/var/log', @@ -71,6 +72,7 @@ describe 'ironic::logging' do is_expected.to contain_oslo__log('ironic_config').with( :use_syslog => '', :use_json => '', + :use_journal => '', :use_stderr => '', :syslog_log_facility => '', :log_dir => '/var/log/ironic', @@ -84,6 +86,7 @@ describe 'ironic::logging' do is_expected.to contain_oslo__log('ironic_config').with( :use_syslog => true, :use_json => true, + :use_journal => true, :use_stderr => false, :syslog_log_facility => 'LOG_FOO', :log_dir => '/var/log',