Add use_journal option for logging configuration
This enables oslo.log to pass logging records to journald. Change-Id: I725c7b1abebd9af1bcc88a40d727129fa756b7dd
This commit is contained in:
parent
b303f151ab
commit
2996093fa9
|
@ -16,6 +16,10 @@
|
|||
# Use json for logging.
|
||||
# (Optional) Defaults to $::os_service_default.
|
||||
#
|
||||
# [*use_journal*]
|
||||
# Use journal for logging.
|
||||
# (Optional) Defaults to $::os_service_default.
|
||||
#
|
||||
# [*use_stderr*]
|
||||
# (optional) Use stderr for logging
|
||||
# Defaults to $::os_service_default.
|
||||
|
@ -93,6 +97,7 @@ class sahara::logging(
|
|||
$debug = $::os_service_default,
|
||||
$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/sahara',
|
||||
|
@ -127,6 +132,7 @@ class sahara::logging(
|
|||
debug => $debug_real,
|
||||
use_syslog => $use_syslog_real,
|
||||
use_json => $use_json,
|
||||
use_journal => $use_journal,
|
||||
use_stderr => $use_stderr_real,
|
||||
log_dir => $log_dir_real,
|
||||
syslog_log_facility => $log_facility_real,
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
features:
|
||||
- |
|
||||
Adds the use_journal option for configuring oslo.log. This will enable
|
||||
passing the logs to journald.
|
|
@ -12,6 +12,7 @@ describe 'sahara::logging' do
|
|||
:debug => 'true',
|
||||
:use_syslog => 'true',
|
||||
:use_json => 'true',
|
||||
:use_journal => 'true',
|
||||
:use_stderr => 'false',
|
||||
:log_facility => 'LOG_LOCAL0',
|
||||
:log_dir => '/tmp/sahara',
|
||||
|
@ -62,11 +63,12 @@ describe 'sahara::logging' do
|
|||
|
||||
context 'with defaults' do
|
||||
it { is_expected.to contain_oslo__log('sahara_config').with(
|
||||
:use_syslog => '<SERVICE DEFAULT>',
|
||||
:use_json => '<SERVICE DEFAULT>',
|
||||
:use_stderr => '<SERVICE DEFAULT>',
|
||||
:log_dir => '/var/log/sahara',
|
||||
:debug => '<SERVICE DEFAULT>',
|
||||
:use_syslog => '<SERVICE DEFAULT>',
|
||||
:use_json => '<SERVICE DEFAULT>',
|
||||
:use_journal => '<SERVICE DEFAULT>',
|
||||
:use_stderr => '<SERVICE DEFAULT>',
|
||||
:log_dir => '/var/log/sahara',
|
||||
:debug => '<SERVICE DEFAULT>',
|
||||
)}
|
||||
end
|
||||
|
||||
|
@ -87,6 +89,7 @@ describe 'sahara::logging' do
|
|||
it { is_expected.to contain_oslo__log('sahara_config').with(
|
||||
:use_syslog => true,
|
||||
:use_json => true,
|
||||
:use_journal => true,
|
||||
:use_stderr => false,
|
||||
:syslog_log_facility => 'LOG_LOCAL0',
|
||||
:log_dir => '/tmp/sahara',
|
||||
|
|
Loading…
Reference in New Issue