diff --git a/manifests/logging.pp b/manifests/logging.pp index 7a46f626..49c915af 100644 --- a/manifests/logging.pp +++ b/manifests/logging.pp @@ -33,6 +33,10 @@ # If set to $::os_service_default, it will not log to any directory. # Defaults to '/var/log/heat' # +# [*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 heat::logging( $use_stderr = $::os_service_default, $log_facility = $::os_service_default, $log_dir = '/var/log/heat', + $log_file = $::os_service_default, $debug = $::os_service_default, $logging_context_format_string = $::os_service_default, $logging_default_format_string = $::os_service_default, @@ -121,6 +126,7 @@ class heat::logging( log_config_append => $log_config_append, log_date_format => $log_date_format, log_dir => $log_dir, + log_file => $log_file, use_syslog => $use_syslog, use_json => $use_json, use_journal => $use_journal, diff --git a/releasenotes/notes/add-log_file-for-logging-951d66e9adda6235.yaml b/releasenotes/notes/add-log_file-for-logging-951d66e9adda6235.yaml new file mode 100644 index 00000000..e40d4c81 --- /dev/null +++ b/releasenotes/notes/add-log_file-for-logging-951d66e9adda6235.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + Add the log_file option for logging. diff --git a/spec/classes/heat_logging_spec.rb b/spec/classes/heat_logging_spec.rb index 104ebf90..24a7c61c 100644 --- a/spec/classes/heat_logging_spec.rb +++ b/spec/classes/heat_logging_spec.rb @@ -29,6 +29,7 @@ describe 'heat::logging' do :use_stderr => false, :log_facility => 'LOG_FOO', :log_dir => '/var/log', + :log_file => '/var/log/heat/heat.log', :debug => true, } end @@ -63,6 +64,7 @@ describe 'heat::logging' do :use_journal => '', :use_stderr => '', :log_dir => '/var/log/heat', + :log_file => '', :debug => '', ) end @@ -77,6 +79,7 @@ describe 'heat::logging' do :use_stderr => false, :syslog_log_facility => 'LOG_FOO', :log_dir => '/var/log', + :log_file => '/var/log/heat/heat.log', :debug => true, ) end