Add log_file parameter

Change-Id: Ib4c8bc9d75317c742ee845db889ce5cd07041144
Closes-Bug: #1819417
This commit is contained in:
ZhongShengping 2019-03-12 10:37:37 +08:00
parent 212f6831b1
commit 6390054934
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'.
# #
# [*log_file*]
# (Optional) File where logs should be stored.
# Defaults to $::os_service_default
#
# [*logging_context_format_string*] # [*logging_context_format_string*]
# (Optional) Format string to use for log messages with context. # (Optional) Format string to use for log messages with context.
# Defaults to $::os_service_default # Defaults to $::os_service_default
@ -101,6 +105,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',
$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,
$logging_default_format_string = $::os_service_default, $logging_default_format_string = $::os_service_default,
@ -124,6 +129,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,
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,
logging_default_format_string => $logging_default_format_string, logging_default_format_string => $logging_default_format_string,

View File

@ -0,0 +1,4 @@
---
features:
- |
Add the log_file option for logging.

View File

@ -29,6 +29,7 @@ describe 'aodh::logging' do
:use_stderr => false, :use_stderr => false,
:log_facility => 'LOG_FOO', :log_facility => 'LOG_FOO',
:log_dir => '/var/log', :log_dir => '/var/log',
:log_file => '/var/log/aodh/aodh.log',
:debug => true, :debug => true,
} }
end end
@ -64,6 +65,7 @@ describe 'aodh::logging' do
:use_stderr => '<SERVICE DEFAULT>', :use_stderr => '<SERVICE DEFAULT>',
:syslog_log_facility => '<SERVICE DEFAULT>', :syslog_log_facility => '<SERVICE DEFAULT>',
:log_dir => '/var/log/aodh', :log_dir => '/var/log/aodh',
:log_file => '<SERVICE DEFAULT>',
:debug => '<SERVICE DEFAULT>', :debug => '<SERVICE DEFAULT>',
) )
end end
@ -78,6 +80,7 @@ describe 'aodh::logging' do
:use_stderr => false, :use_stderr => false,
: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',
:debug => true, :debug => true,
) )
end end