Expose use_json logging option
It enables JSON-formatted logging from oslo.log. Change-Id: I57eaa1209e6942a9e76e7988761fea854c838dc5
This commit is contained in:
parent
05c371d43d
commit
50d7c113f8
@ -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.
|
||||
@ -87,6 +91,7 @@
|
||||
#
|
||||
class heat::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/heat',
|
||||
@ -124,6 +129,7 @@ class heat::logging(
|
||||
log_date_format => $log_date_format,
|
||||
log_dir => $log_dir_real,
|
||||
use_syslog => $use_syslog_real,
|
||||
use_json => $use_json,
|
||||
syslog_log_facility => $log_facility_real,
|
||||
use_stderr => $use_stderr_real,
|
||||
logging_context_format_string => $logging_context_format_string,
|
||||
|
4
releasenotes/notes/log-json-9c7061b9e42a3d20.yaml
Normal file
4
releasenotes/notes/log-json-9c7061b9e42a3d20.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
Expose use_json logging parameter, which enables JSON formatted logging.
|
@ -24,6 +24,7 @@ describe 'heat::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',
|
||||
@ -57,6 +58,7 @@ describe 'heat::logging' do
|
||||
it 'configures heat logging settings with default values' do
|
||||
is_expected.to contain_oslo__log('heat_config').with(
|
||||
:use_syslog => '<SERVICE DEFAULT>',
|
||||
:use_json => '<SERVICE DEFAULT>',
|
||||
:use_stderr => '<SERVICE DEFAULT>',
|
||||
:log_dir => '/var/log/heat',
|
||||
:debug => '<SERVICE DEFAULT>',
|
||||
@ -68,6 +70,7 @@ describe 'heat::logging' do
|
||||
it 'configures heat logging settings with non-default values' do
|
||||
is_expected.to contain_oslo__log('heat_config').with(
|
||||
:use_syslog => true,
|
||||
:use_json => true,
|
||||
:use_stderr => false,
|
||||
:syslog_log_facility => 'LOG_FOO',
|
||||
:log_dir => '/var/log',
|
||||
|
Loading…
Reference in New Issue
Block a user