diff --git a/manifests/logging.pp b/manifests/logging.pp index e04b09d..aeab26d 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. @@ -91,6 +95,7 @@ class zaqar::logging( $use_syslog = $::os_service_default, + $use_json = $::os_service_default, $use_stderr = $::os_service_default, $log_facility = $::os_service_default, $log_dir = '/var/log/zaqar', @@ -123,6 +128,7 @@ class zaqar::logging( instance_uuid_format => $instance_uuid_format, log_date_format => $log_date_format, use_syslog => $use_syslog, + use_json => $use_json, use_stderr => $use_stderr, syslog_log_facility => $log_facility, log_dir => $log_dir, diff --git a/releasenotes/notes/log-json-73790092ddf0cc73.yaml b/releasenotes/notes/log-json-73790092ddf0cc73.yaml new file mode 100644 index 0000000..41c0413 --- /dev/null +++ b/releasenotes/notes/log-json-73790092ddf0cc73.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + Expose use_json logging parameter, which enables JSON formatted logging. diff --git a/spec/classes/zaqar_logging_spec.rb b/spec/classes/zaqar_logging_spec.rb index 69fe777..ce4e47b 100644 --- a/spec/classes/zaqar_logging_spec.rb +++ b/spec/classes/zaqar_logging_spec.rb @@ -24,6 +24,7 @@ describe 'zaqar::logging' do :instance_uuid_format => '[instance: %(uuid)s] ', :log_date_format => '%Y-%m-%d %H:%M:%S', :use_syslog => true, + :use_json => true, :use_stderr => false, :log_facility => 'LOG_FOO', :log_dir => '/var/log', @@ -48,6 +49,7 @@ describe 'zaqar::logging' do it 'configures zaqar logging settings with default values' do is_expected.to contain_oslo__log('zaqar_config').with( :use_syslog => '', + :use_json => '', :use_stderr => '', :log_dir => '/var/log/zaqar', :debug => '', @@ -59,6 +61,7 @@ describe 'zaqar::logging' do it 'configures zaqar logging settings with non-default values' do is_expected.to contain_oslo__log('zaqar_config').with( :use_syslog => true, + :use_json => true, :use_stderr => false, :syslog_log_facility => 'LOG_FOO', :log_dir => '/var/log',