diff --git a/manifests/logging.pp b/manifests/logging.pp index aeab26d..e3701ce 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. @@ -96,6 +100,7 @@ class zaqar::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/zaqar', @@ -129,6 +134,7 @@ class zaqar::logging( log_date_format => $log_date_format, use_syslog => $use_syslog, use_json => $use_json, + use_journal => $use_journal, use_stderr => $use_stderr, syslog_log_facility => $log_facility, log_dir => $log_dir, diff --git a/releasenotes/notes/add-use_journal-option-for-logging-91f73f2743593a70.yaml b/releasenotes/notes/add-use_journal-option-for-logging-91f73f2743593a70.yaml new file mode 100644 index 0000000..12b190e --- /dev/null +++ b/releasenotes/notes/add-use_journal-option-for-logging-91f73f2743593a70.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/zaqar_logging_spec.rb b/spec/classes/zaqar_logging_spec.rb index ce4e47b..80a316d 100644 --- a/spec/classes/zaqar_logging_spec.rb +++ b/spec/classes/zaqar_logging_spec.rb @@ -25,6 +25,7 @@ describe 'zaqar::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', @@ -48,11 +49,12 @@ describe 'zaqar::logging' do shared_examples 'basic default logging settings' do it 'configures zaqar logging settings with default values' do is_expected.to contain_oslo__log('zaqar_config').with( - :use_syslog => '', - :use_json => '', - :use_stderr => '', - :log_dir => '/var/log/zaqar', - :debug => '', + :use_syslog => '', + :use_json => '', + :use_journal => '', + :use_stderr => '', + :log_dir => '/var/log/zaqar', + :debug => '', ) end end @@ -62,6 +64,7 @@ describe 'zaqar::logging' do is_expected.to contain_oslo__log('zaqar_config').with( :use_syslog => true, :use_json => true, + :use_journal => true, :use_stderr => false, :syslog_log_facility => 'LOG_FOO', :log_dir => '/var/log',