diff --git a/manifests/log.pp b/manifests/log.pp index 41291c6..0e1d0b2 100644 --- a/manifests/log.pp +++ b/manifests/log.pp @@ -48,6 +48,10 @@ # This option is ignored if log_config_append is set. # Defaults to $::os_service_default # +# [*use_json*] +# (Optional) Use JSON format for logging (boolean value). +# Defaults to $::os_service_default +# # [*use_stderr*] # (Optional) Log output to standard error. # This option is ignored if log_config_append is set. @@ -115,6 +119,7 @@ define oslo::log( $watch_log_file = $::os_service_default, $use_syslog = $::os_service_default, $use_journal = $::os_service_default, + $use_json = $::os_service_default, $syslog_log_facility = $::os_service_default, $use_stderr = $::os_service_default, $logging_context_format_string = $::os_service_default, @@ -153,6 +158,7 @@ define oslo::log( 'DEFAULT/watch_log_file' => { value => $watch_log_file }, 'DEFAULT/use_syslog' => { value => $use_syslog }, 'DEFAULT/use_journal' => { value => $use_journal }, + 'DEFAULT/use_json' => { value => $use_json }, 'DEFAULT/syslog_log_facility' => { value => $syslog_log_facility }, 'DEFAULT/use_stderr' => { value => $use_stderr }, 'DEFAULT/logging_context_format_string' => { value => $logging_context_format_string }, diff --git a/releasenotes/notes/log-json-70816c646023e567.yaml b/releasenotes/notes/log-json-70816c646023e567.yaml new file mode 100644 index 0000000..41c0413 --- /dev/null +++ b/releasenotes/notes/log-json-70816c646023e567.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + Expose use_json logging parameter, which enables JSON formatted logging. diff --git a/spec/defines/oslo_log_spec.rb b/spec/defines/oslo_log_spec.rb index c0ebb2d..329fa04 100644 --- a/spec/defines/oslo_log_spec.rb +++ b/spec/defines/oslo_log_spec.rb @@ -16,6 +16,7 @@ describe 'oslo::log' do is_expected.to contain_keystone_config('DEFAULT/watch_log_file').with_value('') is_expected.to contain_keystone_config('DEFAULT/use_syslog').with_value('') is_expected.to contain_keystone_config('DEFAULT/use_journal').with_value('') + is_expected.to contain_keystone_config('DEFAULT/use_json').with_value('') is_expected.to contain_keystone_config('DEFAULT/syslog_log_facility').with_value('') is_expected.to contain_keystone_config('DEFAULT/use_stderr').with_value('') is_expected.to contain_keystone_config('DEFAULT/logging_context_format_string').with_value('') @@ -41,6 +42,7 @@ describe 'oslo::log' do :watch_log_file => true, :use_syslog => true, :use_journal => true, + :use_json => true, :syslog_log_facility => 'LOG_USER', :use_stderr => true, :logging_context_format_string => @@ -68,6 +70,7 @@ describe 'oslo::log' do is_expected.to contain_keystone_config('DEFAULT/watch_log_file').with_value(true) is_expected.to contain_keystone_config('DEFAULT/use_syslog').with_value(true) is_expected.to contain_keystone_config('DEFAULT/use_journal').with_value(true) + is_expected.to contain_keystone_config('DEFAULT/use_json').with_value(true) is_expected.to contain_keystone_config('DEFAULT/syslog_log_facility').with_value('LOG_USER') is_expected.to contain_keystone_config('DEFAULT/use_stderr').with_value(true) is_expected.to contain_keystone_config('DEFAULT/logging_context_format_string').with_value(