Add watch_log_file option
Add support for Using logging handler designed to watch file system. Change-Id: I0097c68ea253b1cee58132e677adc39dd7c3b20a Closes-Bug: #1943212
This commit is contained in:
@@ -38,6 +38,10 @@
|
|||||||
# (Optional) File where logs should be stored.
|
# (Optional) File where logs should be stored.
|
||||||
# Defaults to $::os_service_default
|
# Defaults to $::os_service_default
|
||||||
#
|
#
|
||||||
|
# [*watch_log_file*]
|
||||||
|
# (Optional) Uses logging handler designed to watch file system (boolean value).
|
||||||
|
# Defaults to $::os_service_default
|
||||||
|
#
|
||||||
class gnocchi::logging(
|
class gnocchi::logging(
|
||||||
$use_syslog = $::os_service_default,
|
$use_syslog = $::os_service_default,
|
||||||
$use_json = $::os_service_default,
|
$use_json = $::os_service_default,
|
||||||
@@ -46,6 +50,7 @@ class gnocchi::logging(
|
|||||||
$log_facility = $::os_service_default,
|
$log_facility = $::os_service_default,
|
||||||
$log_dir = '/var/log/gnocchi',
|
$log_dir = '/var/log/gnocchi',
|
||||||
$log_file = $::os_service_default,
|
$log_file = $::os_service_default,
|
||||||
|
$watch_log_file = $::os_service_default,
|
||||||
$debug = $::os_service_default,
|
$debug = $::os_service_default,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
@@ -59,6 +64,7 @@ class gnocchi::logging(
|
|||||||
use_stderr => $use_stderr,
|
use_stderr => $use_stderr,
|
||||||
log_dir => $log_dir,
|
log_dir => $log_dir,
|
||||||
log_file => $log_file,
|
log_file => $log_file,
|
||||||
|
watch_log_file => $watch_log_file,
|
||||||
syslog_log_facility => $log_facility,
|
syslog_log_facility => $log_facility,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
The new ``gnocchi::logging::watch_log_file`` parameter has been added.
|
||||||
@@ -9,14 +9,15 @@ describe 'gnocchi::logging' do
|
|||||||
|
|
||||||
let :log_params do
|
let :log_params do
|
||||||
{
|
{
|
||||||
:use_syslog => true,
|
:use_syslog => true,
|
||||||
:use_json => true,
|
:use_json => true,
|
||||||
:use_journal => true,
|
:use_journal => true,
|
||||||
: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/gnocchi/gnocchi.log',
|
:log_file => '/var/log/gnocchi/gnocchi.log',
|
||||||
:debug => true,
|
:watch_log_file => true,
|
||||||
|
:debug => true,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -43,6 +44,7 @@ describe 'gnocchi::logging' do
|
|||||||
:syslog_log_facility => '<SERVICE DEFAULT>',
|
:syslog_log_facility => '<SERVICE DEFAULT>',
|
||||||
:log_dir => '/var/log/gnocchi',
|
:log_dir => '/var/log/gnocchi',
|
||||||
:log_file => '<SERVICE DEFAULT>',
|
:log_file => '<SERVICE DEFAULT>',
|
||||||
|
:watch_log_file => '<SERVICE DEFAULT>',
|
||||||
:debug => '<SERVICE DEFAULT>',
|
:debug => '<SERVICE DEFAULT>',
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
@@ -58,6 +60,7 @@ describe 'gnocchi::logging' do
|
|||||||
:syslog_log_facility => 'LOG_FOO',
|
:syslog_log_facility => 'LOG_FOO',
|
||||||
:log_dir => '/var/log',
|
:log_dir => '/var/log',
|
||||||
:log_file => '/var/log/gnocchi/gnocchi.log',
|
:log_file => '/var/log/gnocchi/gnocchi.log',
|
||||||
|
:watch_log_file => true,
|
||||||
:debug => true,
|
:debug => true,
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user