diff --git a/manifests/logging.pp b/manifests/logging.pp index 61c2c7f7..9ed37d5a 100644 --- a/manifests/logging.pp +++ b/manifests/logging.pp @@ -34,6 +34,10 @@ # any directory. # Defaults to '/var/log/gnocchi' # +# [*log_file*] +# (Optional) File where logs should be stored. +# Defaults to $::os_service_default +# class gnocchi::logging( $use_syslog = $::os_service_default, $use_json = $::os_service_default, @@ -41,6 +45,7 @@ class gnocchi::logging( $use_stderr = $::os_service_default, $log_facility = $::os_service_default, $log_dir = '/var/log/gnocchi', + $log_file = $::os_service_default, $debug = $::os_service_default, ) { @@ -53,6 +58,7 @@ class gnocchi::logging( use_journal => $use_journal, use_stderr => $use_stderr, log_dir => $log_dir, + log_file => $log_file, syslog_log_facility => $log_facility, } diff --git a/releasenotes/notes/add-log_file-for-logging-b978d0ad122b36ed.yaml b/releasenotes/notes/add-log_file-for-logging-b978d0ad122b36ed.yaml new file mode 100644 index 00000000..e40d4c81 --- /dev/null +++ b/releasenotes/notes/add-log_file-for-logging-b978d0ad122b36ed.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + Add the log_file option for logging. diff --git a/spec/classes/gnocchi_logging_spec.rb b/spec/classes/gnocchi_logging_spec.rb index f5738296..024deb6c 100644 --- a/spec/classes/gnocchi_logging_spec.rb +++ b/spec/classes/gnocchi_logging_spec.rb @@ -15,6 +15,7 @@ describe 'gnocchi::logging' do :use_stderr => false, :log_facility => 'LOG_FOO', :log_dir => '/var/log', + :log_file => '/var/log/gnocchi/gnocchi.log', :debug => true, } end @@ -41,6 +42,7 @@ describe 'gnocchi::logging' do :use_stderr => '', :syslog_log_facility => '', :log_dir => '/var/log/gnocchi', + :log_file => '', :debug => '', ) end @@ -55,6 +57,7 @@ describe 'gnocchi::logging' do :use_stderr => false, :syslog_log_facility => 'LOG_FOO', :log_dir => '/var/log', + :log_file => '/var/log/gnocchi/gnocchi.log', :debug => true, ) end