Add watch_log_file option

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

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

View File

@ -34,6 +34,10 @@
# any directory. # any directory.
# Defaults to '/var/log/aodh'. # Defaults to '/var/log/aodh'.
# #
# [*watch_log_file*]
# (Optional) Uses logging handler designed to watch file system (boolean value).
# Defaults to $::os_service_default
#
# [*log_file*] # [*log_file*]
# (Optional) File where logs should be stored. # (Optional) File where logs should be stored.
# Defaults to $::os_service_default # Defaults to $::os_service_default
@ -105,6 +109,7 @@ class aodh::logging(
$use_stderr = $::os_service_default, $use_stderr = $::os_service_default,
$log_facility = $::os_service_default, $log_facility = $::os_service_default,
$log_dir = '/var/log/aodh', $log_dir = '/var/log/aodh',
$watch_log_file = $::os_service_default,
$log_file = $::os_service_default, $log_file = $::os_service_default,
$debug = $::os_service_default, $debug = $::os_service_default,
$logging_context_format_string = $::os_service_default, $logging_context_format_string = $::os_service_default,
@ -129,6 +134,7 @@ class aodh::logging(
use_journal => $use_journal, use_journal => $use_journal,
use_stderr => $use_stderr, use_stderr => $use_stderr,
log_dir => $log_dir, log_dir => $log_dir,
watch_log_file => $watch_log_file,
log_file => $log_file, log_file => $log_file,
syslog_log_facility => $log_facility, syslog_log_facility => $log_facility,
logging_context_format_string => $logging_context_format_string, logging_context_format_string => $logging_context_format_string,

View File

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

View File

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