From 963ad9dd1ca6d2fefabd97bd323c4f79303b2df4 Mon Sep 17 00:00:00 2001 From: Julian Brost Date: Wed, 23 Jun 2021 16:48:48 +0200 Subject: [PATCH] Set a default severity for loggers So far, the documentation has claimed that loggers have a default severity (information for FileLogger and warning for SyslogLogger). However, this was not the case and not setting the severity resulted in a configuration error. This commit changes the default value to be information for all loggers. --- doc/09-object-types.md | 2 +- lib/base/logger.ti | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/09-object-types.md b/doc/09-object-types.md index f24a35b8d..b16630de4 100644 --- a/doc/09-object-types.md +++ b/doc/09-object-types.md @@ -1835,7 +1835,7 @@ Configuration Attributes: Name | Type | Description --------------------------|-----------------------|---------------------------------- - severity | String | **Optional.** The minimum severity for this log. Can be "debug", "notice", "information", "warning" or "critical". Defaults to "warning". + severity | String | **Optional.** The minimum severity for this log. Can be "debug", "notice", "information", "warning" or "critical". Defaults to "information". facility | String | **Optional.** Defines the facility to use for syslog entries. This can be a facility constant like `FacilityDaemon`. Defaults to `FacilityUser`. Facility Constants: diff --git a/lib/base/logger.ti b/lib/base/logger.ti index df68b2540..b9776c83d 100644 --- a/lib/base/logger.ti +++ b/lib/base/logger.ti @@ -9,7 +9,9 @@ namespace icinga abstract class Logger : ConfigObject { - [config] String severity; + [config] String severity { + default {{{ return "information"; }}} + }; }; }