Browse Source

Add use_journal option for logging configuration

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

Change-Id: Ie7d9deff5d6934f60d4c396520089836bd661767
changes/21/533521/2
ZhongShengping 4 years ago
parent
commit
994e23c297
  1. 6
      manifests/logging.pp
  2. 5
      releasenotes/notes/add-use_journal-option-for-logging-9563deb9e59d2cb1.yaml
  3. 3
      spec/classes/ceilometer_logging_spec.rb

6
manifests/logging.pp

@ -16,6 +16,10 @@
# (Optional) Use json for logging.
# Defaults to $::os_service_default.
#
# [*use_journal*]
# (Optional) Use journal for logging.
# Defaults to $::os_service_default.
#
# [*use_stderr*]
# (Optional) Use stderr for logging
# Defaults to $::os_service_default.
@ -92,6 +96,7 @@
class ceilometer::logging(
$use_syslog = $::os_service_default,
$use_json = $::os_service_default,
$use_journal = $::os_service_default,
$use_stderr = $::os_service_default,
$log_facility = $::os_service_default,
$log_dir = '/var/log/ceilometer',
@ -128,6 +133,7 @@ class ceilometer::logging(
use_stderr => $use_stderr_real,
use_syslog => $use_syslog_real,
use_json => $use_json,
use_journal => $use_journal,
log_dir => $log_dir_real,
syslog_log_facility => $log_facility_real,
logging_context_format_string => $logging_context_format_string,

5
releasenotes/notes/add-use_journal-option-for-logging-9563deb9e59d2cb1.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/classes/ceilometer_logging_spec.rb

@ -25,6 +25,7 @@ describe 'ceilometer::logging' do
:log_date_format => '%Y-%m-%d %H:%M:%S',
:use_syslog => true,
:use_json => true,
:use_journal => true,
:use_stderr => false,
:log_facility => 'LOG_FOO',
:log_dir => '/var/log',
@ -59,6 +60,7 @@ describe 'ceilometer::logging' do
is_expected.to contain_oslo__log('ceilometer_config').with(
:use_syslog => '<SERVICE DEFAULT>',
:use_json => '<SERVICE DEFAULT>',
:use_journal => '<SERVICE DEFAULT>',
:use_stderr => '<SERVICE DEFAULT>',
:syslog_log_facility => '<SERVICE DEFAULT>',
:log_dir => '/var/log/ceilometer',
@ -72,6 +74,7 @@ describe 'ceilometer::logging' do
is_expected.to contain_oslo__log('ceilometer_config').with(
:use_syslog => true,
:use_json => true,
:use_journal => true,
:use_stderr => false,
:syslog_log_facility => 'LOG_FOO',
:log_dir => '/var/log',

Loading…
Cancel
Save