From ce7b93f888e6943e657b6decffdf8e6fa8fdac45 Mon Sep 17 00:00:00 2001 From: ZhongShengping Date: Tue, 14 Sep 2021 16:02:09 +0800 Subject: [PATCH] Add watch_log_file option Add support for Using logging handler designed to watch file system. Change-Id: I5316125602858a418efa2c134edb3f5328a62b61 Closes-Bug: #1943212 --- manifests/logging.pp | 6 ++++++ ..._watch_log_file-option-b96b7bb227849614.yaml | 4 ++++ spec/classes/rally_logging_spec.rb | 17 ++++++++++------- 3 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 releasenotes/notes/add_watch_log_file-option-b96b7bb227849614.yaml diff --git a/manifests/logging.pp b/manifests/logging.pp index 7655426..7c85540 100644 --- a/manifests/logging.pp +++ b/manifests/logging.pp @@ -37,6 +37,10 @@ # (Optional) File where logs should be stored. # Defaults to $::os_service_default # +# [*watch_log_file*] +# (Optional) Uses logging handler designed to watch file system (boolean value). +# Defaults to $::os_service_default +# # [*logging_context_format_string*] # (Optional) Format string to use for log messages with context. # Defaults to $::os_service_default @@ -108,6 +112,7 @@ class rally::logging( $use_stderr = $::os_service_default, $log_facility = $::os_service_default, $log_file = $::os_service_default, + $watch_log_file = $::os_service_default, $log_dir = '/var/log/rally', $debug = $::os_service_default, $logging_context_format_string = $::os_service_default, @@ -133,6 +138,7 @@ class rally::logging( use_stderr => $use_stderr, log_dir => $log_dir, log_file => $log_file, + watch_log_file => $watch_log_file, syslog_log_facility => $log_facility, logging_context_format_string => $logging_context_format_string, logging_default_format_string => $logging_default_format_string, diff --git a/releasenotes/notes/add_watch_log_file-option-b96b7bb227849614.yaml b/releasenotes/notes/add_watch_log_file-option-b96b7bb227849614.yaml new file mode 100644 index 0000000..5ac5b27 --- /dev/null +++ b/releasenotes/notes/add_watch_log_file-option-b96b7bb227849614.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + The new ``rally::logging::watch_log_file`` parameter has been added. diff --git a/spec/classes/rally_logging_spec.rb b/spec/classes/rally_logging_spec.rb index 183d0d7..774792f 100644 --- a/spec/classes/rally_logging_spec.rb +++ b/spec/classes/rally_logging_spec.rb @@ -30,6 +30,7 @@ describe 'rally::logging' do :log_facility => 'LOG_FOO', :log_dir => '/var/log', :log_file => '/var/tmp/rally_random.log', + :watch_log_file => true, :debug => true, } end @@ -59,13 +60,14 @@ describe 'rally::logging' do shared_examples 'basic default logging settings' do it 'configures rally logging settings with default values' do is_expected.to contain_oslo__log('rally_config').with( - :use_syslog => '', - :use_json => '', - :use_journal => '', - :use_stderr => '', - :log_dir => '/var/log/rally', - :log_file => '', - :debug => '', + :use_syslog => '', + :use_json => '', + :use_journal => '', + :use_stderr => '', + :log_dir => '/var/log/rally', + :log_file => '', + :watch_log_file => '', + :debug => '', ) end end @@ -80,6 +82,7 @@ describe 'rally::logging' do :syslog_log_facility => 'LOG_FOO', :log_dir => '/var/log', :log_file => '/var/tmp/rally_random.log', + :watch_log_file => true, :debug => true, ) end