From e40e45628bfb9736688d6e87193bdfc46ff2dc50 Mon Sep 17 00:00:00 2001 From: ZhongShengping Date: Tue, 12 Mar 2019 10:37:39 +0800 Subject: [PATCH] Add log_file parameter Change-Id: I8eeea0b84fd12d71adf9665113a925394272f691 Closes-Bug: #1819417 --- manifests/logging.pp | 6 ++++++ .../notes/add-log_file-for-logging-9aa0a919d7d36bc2.yaml | 4 ++++ spec/classes/mistral_logging_spec.rb | 3 +++ 3 files changed, 13 insertions(+) create mode 100644 releasenotes/notes/add-log_file-for-logging-9aa0a919d7d36bc2.yaml diff --git a/manifests/logging.pp b/manifests/logging.pp index 4aafdf8..f19fc63 100644 --- a/manifests/logging.pp +++ b/manifests/logging.pp @@ -34,6 +34,10 @@ # directory. # Defaults to '/var/log/mistral' # +# [*log_file*] +# (Optional) File where logs should be stored. +# Defaults to $::os_service_default +# # [*logging_context_format_string*] # (Optional) Format string to use for log messages with context. # Defaults to $::os_service_default @@ -101,6 +105,7 @@ class mistral::logging( $use_stderr = $::os_service_default, $log_facility = $::os_service_default, $log_dir = '/var/log/mistral', + $log_file = $::os_service_default, $debug = $::os_service_default, $logging_context_format_string = $::os_service_default, $logging_default_format_string = $::os_service_default, @@ -124,6 +129,7 @@ class mistral::logging( use_stderr => $use_stderr, syslog_log_facility => $log_facility, log_dir => $log_dir, + log_file => $log_file, debug => $debug, default_log_levels => $default_log_levels, logging_context_format_string => $logging_context_format_string, diff --git a/releasenotes/notes/add-log_file-for-logging-9aa0a919d7d36bc2.yaml b/releasenotes/notes/add-log_file-for-logging-9aa0a919d7d36bc2.yaml new file mode 100644 index 0000000..e40d4c8 --- /dev/null +++ b/releasenotes/notes/add-log_file-for-logging-9aa0a919d7d36bc2.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + Add the log_file option for logging. diff --git a/spec/classes/mistral_logging_spec.rb b/spec/classes/mistral_logging_spec.rb index 62445af..e21986d 100644 --- a/spec/classes/mistral_logging_spec.rb +++ b/spec/classes/mistral_logging_spec.rb @@ -29,6 +29,7 @@ describe 'mistral::logging' do :use_stderr => false, :log_facility => 'LOG_FOO', :log_dir => '/var/log', + :log_file => '/var/log/mistral/mistral.log', :debug => true, } end @@ -64,6 +65,7 @@ describe 'mistral::logging' do :use_stderr => '', :syslog_log_facility => '', :log_dir => '/var/log/mistral', + :log_file => '', :debug => '', ) end @@ -78,6 +80,7 @@ describe 'mistral::logging' do :use_stderr => false, :syslog_log_facility => 'LOG_FOO', :log_dir => '/var/log', + :log_file => '/var/log/mistral/mistral.log', :debug => true, ) end