Add watch_log_file option

Add support for Using logging handler designed to watch file system.

Change-Id: I888a398b156239804feb31010894e400b2c04f2f
Closes-Bug: #1943212
This commit is contained in:
ZhongShengping 2021-09-14 16:02:09 +08:00
parent 51294c92aa
commit 3c26187e67
3 changed files with 13 additions and 0 deletions

View File

@ -38,6 +38,10 @@
# If set to $::os_service_default, it will not log to any file.
# Defaults to $::os_service_default
#
# [*watch_log_file*]
# (Optional) Uses logging handler designed to watch file system (boolean value).
# Defaults to $::os_service_default
#
# [*logging_context_format_string*]
# (Optional) Format string to use for log messages with context.
# Defaults to $::os_service_default
@ -106,6 +110,7 @@ class trove::logging(
$log_facility = $::os_service_default,
$log_dir = '/var/log/trove',
$log_file = $::os_service_default,
$watch_log_file = $::os_service_default,
$debug = $::os_service_default,
$logging_context_format_string = $::os_service_default,
$logging_default_format_string = $::os_service_default,
@ -130,6 +135,7 @@ class trove::logging(
use_journal => $use_journal,
log_dir => $log_dir,
log_file => $log_file,
watch_log_file => $watch_log_file,
syslog_log_facility => $log_facility,
logging_context_format_string => $logging_context_format_string,
logging_default_format_string => $logging_default_format_string,

View File

@ -0,0 +1,4 @@
---
features:
- |
The new ``trove::logging::watch_log_file`` parameter has been added.

View File

@ -30,6 +30,7 @@ describe 'trove::logging' do
:log_facility => 'LOG_FOO',
:log_dir => '/var/log',
:log_file => '/var/tmp/trove_random.log',
:watch_log_file => true,
:debug => true,
}
end
@ -66,6 +67,7 @@ describe 'trove::logging' do
:syslog_log_facility => '<SERVICE DEFAULT>',
:log_dir => '/var/log/trove',
:log_file => '<SERVICE DEFAULT>',
:watch_log_file => '<SERVICE DEFAULT>',
:debug => '<SERVICE DEFAULT>',
)
end
@ -81,6 +83,7 @@ describe 'trove::logging' do
:syslog_log_facility => 'LOG_FOO',
:log_dir => '/var/log',
:log_file => '/var/tmp/trove_random.log',
:watch_log_file => true,
:debug => true,
)
end