diff --git a/manifests/logging.pp b/manifests/logging.pp index 499d4e2..6719f3c 100644 --- a/manifests/logging.pp +++ b/manifests/logging.pp @@ -33,6 +33,10 @@ # If set to boolean false, it will not log to any directory. # Defaults to '/var/log/magnum'. # +# [*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 @@ -104,6 +108,7 @@ class magnum::logging( $use_stderr = $::os_service_default, $log_facility = $::os_service_default, $log_dir = '/var/log/magnum', + $log_file = $::os_service_default, $debug = $::os_service_default, $logging_context_format_string = $::os_service_default, $logging_default_format_string = $::os_service_default, @@ -127,6 +132,7 @@ class magnum::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-ac7fd2e8608813c9.yaml b/releasenotes/notes/add-log_file-for-logging-ac7fd2e8608813c9.yaml new file mode 100644 index 0000000..e40d4c8 --- /dev/null +++ b/releasenotes/notes/add-log_file-for-logging-ac7fd2e8608813c9.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + Add the log_file option for logging. diff --git a/spec/classes/magnum_logging_spec.rb b/spec/classes/magnum_logging_spec.rb index a62002d..5cae98b 100644 --- a/spec/classes/magnum_logging_spec.rb +++ b/spec/classes/magnum_logging_spec.rb @@ -29,6 +29,7 @@ describe 'magnum::logging' do :use_stderr => false, :log_facility => 'LOG_FOO', :log_dir => '/var/log', + :log_file => '/var/log/magnum/magnum.log', :debug => true, } end @@ -63,6 +64,7 @@ describe 'magnum::logging' do :use_journal => '', :use_stderr => '', :log_dir => '/var/log/magnum', + :log_file => '', :debug => '', ) end @@ -77,6 +79,7 @@ describe 'magnum::logging' do :use_stderr => false, :syslog_log_facility => 'LOG_FOO', :log_dir => '/var/log', + :log_file => '/var/log/magnum/magnum.log', :debug => true, ) end