diff --git a/manifests/logging.pp b/manifests/logging.pp index c020e991..1cc63e2d 100644 --- a/manifests/logging.pp +++ b/manifests/logging.pp @@ -33,6 +33,10 @@ # directory. # Defaults to '/var/log/cinder' # +# [*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 @@ -100,6 +104,7 @@ class cinder::logging( $use_stderr = $::os_service_default, $log_facility = $::os_service_default, $log_dir = '/var/log/cinder', + $log_file = $::os_service_default, $debug = $::os_service_default, $logging_context_format_string = $::os_service_default, $logging_default_format_string = $::os_service_default, @@ -123,6 +128,7 @@ class cinder::logging( use_journal => $use_journal, use_stderr => $use_stderr, log_dir => $log_dir, + log_file => $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-log_file-for-logging-a9bbd949ed55b7f0.yaml b/releasenotes/notes/add-log_file-for-logging-a9bbd949ed55b7f0.yaml new file mode 100644 index 00000000..e40d4c81 --- /dev/null +++ b/releasenotes/notes/add-log_file-for-logging-a9bbd949ed55b7f0.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + Add the log_file option for logging. diff --git a/spec/classes/cinder_logging_spec.rb b/spec/classes/cinder_logging_spec.rb index d53943b6..75afb885 100644 --- a/spec/classes/cinder_logging_spec.rb +++ b/spec/classes/cinder_logging_spec.rb @@ -28,6 +28,7 @@ describe 'cinder::logging' do :use_stderr => false, :log_facility => 'LOG_FOO', :log_dir => '/var/log', + :log_file => '/var/log/cinder/cinder.log', :debug => true, } end @@ -62,6 +63,7 @@ describe 'cinder::logging' do :use_journal => '', :use_stderr => '', :log_dir => '/var/log/cinder', + :log_file => '', :debug => '', ) end @@ -76,6 +78,7 @@ describe 'cinder::logging' do :use_stderr => false, :syslog_log_facility => 'LOG_FOO', :log_dir => '/var/log', + :log_file => '/var/log/cinder/cinder.log', :debug => true, ) end