diff --git a/manifests/logging.pp b/manifests/logging.pp index c86a13781..81c83bfb2 100644 --- a/manifests/logging.pp +++ b/manifests/logging.pp @@ -12,6 +12,10 @@ # (optional) Use syslog for logging # Defaults to $::os_service_default # +# [*use_json*] +# (optional) Use json for logging +# Defaults to $::os_service_default +# # [*use_stderr*] # (optional) Use stderr for logging # Defaults to $::os_service_default @@ -100,6 +104,7 @@ class neutron::logging ( $debug = $::os_service_default, $use_syslog = $::os_service_default, + $use_json = $::os_service_default, $use_stderr = $::os_service_default, $log_file = $::os_service_default, $log_dir = '/var/log/neutron', @@ -135,6 +140,7 @@ class neutron::logging ( debug => $debug_real, use_stderr => $use_stderr_real, use_syslog => $use_syslog_real, + use_json => $use_json, syslog_log_facility => $syslog_log_facility, log_file => $log_file_real, log_dir => $log_dir_real, diff --git a/releasenotes/notes/log-json-682e2dda40061831.yaml b/releasenotes/notes/log-json-682e2dda40061831.yaml new file mode 100644 index 000000000..41c04132a --- /dev/null +++ b/releasenotes/notes/log-json-682e2dda40061831.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + Expose use_json logging parameter, which enables JSON formatted logging. diff --git a/spec/classes/neutron_logging_spec.rb b/spec/classes/neutron_logging_spec.rb index 110b8e542..022eff481 100644 --- a/spec/classes/neutron_logging_spec.rb +++ b/spec/classes/neutron_logging_spec.rb @@ -25,6 +25,7 @@ describe 'neutron::logging' do :instance_uuid_format => '[instance: %(uuid)s] ', :log_date_format => '%Y-%m-%d %H:%M:%S', :use_syslog => false, + :use_json => false, :use_stderr => false, :syslog_log_facility => 'LOG_USER', :log_dir => '/var/log', @@ -56,6 +57,7 @@ describe 'neutron::logging' do it 'configures neutron logging settings with default values' do is_expected.to contain_oslo__log('neutron_config').with( :use_syslog => '', + :use_json => '', :use_stderr => '', :syslog_log_facility => '', :log_dir => '/var/log/neutron', @@ -70,6 +72,7 @@ describe 'neutron::logging' do it 'configures neutron logging settings with non-default values' do is_expected.to contain_oslo__log('neutron_config').with( :use_syslog => false, + :use_json => false, :use_stderr => false, :syslog_log_facility => 'LOG_USER', :log_dir => '/var/log',