Browse Source

Add use_journal option for logging configuration

This enables oslo.log to pass logging records to journald.

Change-Id: I2f2977d88607939c278815cc449a129e8c04379d
changes/97/508497/1
Juan Antonio Osorio Robles 5 years ago
parent
commit
f32c680d5e
  1. 6
      manifests/log.pp
  2. 5
      releasenotes/notes/Add-use_journal-option-for-logging-e8182a1cd944ef59.yaml
  3. 3
      spec/defines/oslo_log_spec.rb

6
manifests/log.pp

@ -39,6 +39,10 @@
# (Optional) Use syslog for logging (boolean value).
# Defaults to $::os_service_default
#
# [*use_journal*]
# (Optional) Use journald for logging (boolean value).
# Defaults to $::os_service_default
#
# [*syslog_log_facility*]
# (Optional) Syslog facility to receive log lines.
# This option is ignored if log_config_append is set.
@ -110,6 +114,7 @@ define oslo::log(
$log_dir = $::os_service_default,
$watch_log_file = $::os_service_default,
$use_syslog = $::os_service_default,
$use_journal = $::os_service_default,
$syslog_log_facility = $::os_service_default,
$use_stderr = $::os_service_default,
$logging_context_format_string = $::os_service_default,
@ -147,6 +152,7 @@ define oslo::log(
'DEFAULT/log_dir' => { value => $log_dir },
'DEFAULT/watch_log_file' => { value => $watch_log_file },
'DEFAULT/use_syslog' => { value => $use_syslog },
'DEFAULT/use_journal' => { value => $use_journal },
'DEFAULT/syslog_log_facility' => { value => $syslog_log_facility },
'DEFAULT/use_stderr' => { value => $use_stderr },
'DEFAULT/logging_context_format_string' => { value => $logging_context_format_string },

5
releasenotes/notes/Add-use_journal-option-for-logging-e8182a1cd944ef59.yaml

@ -0,0 +1,5 @@
---
features:
- |
Adds the use_journal option for configuring oslo.log. This will enable
passing the logs to journald.

3
spec/defines/oslo_log_spec.rb

@ -15,6 +15,7 @@ describe 'oslo::log' do
is_expected.to contain_keystone_config('DEFAULT/log_dir').with_value('<SERVICE DEFAULT>')
is_expected.to contain_keystone_config('DEFAULT/watch_log_file').with_value('<SERVICE DEFAULT>')
is_expected.to contain_keystone_config('DEFAULT/use_syslog').with_value('<SERVICE DEFAULT>')
is_expected.to contain_keystone_config('DEFAULT/use_journal').with_value('<SERVICE DEFAULT>')
is_expected.to contain_keystone_config('DEFAULT/syslog_log_facility').with_value('<SERVICE DEFAULT>')
is_expected.to contain_keystone_config('DEFAULT/use_stderr').with_value('<SERVICE DEFAULT>')
is_expected.to contain_keystone_config('DEFAULT/logging_context_format_string').with_value('<SERVICE DEFAULT>')
@ -39,6 +40,7 @@ describe 'oslo::log' do
:log_dir => '/var/log/keystone',
:watch_log_file => true,
:use_syslog => true,
:use_journal => true,
:syslog_log_facility => 'LOG_USER',
:use_stderr => true,
:logging_context_format_string =>
@ -65,6 +67,7 @@ describe 'oslo::log' do
is_expected.to contain_keystone_config('DEFAULT/log_dir').with_value('/var/log/keystone')
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/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(

Loading…
Cancel
Save