From: Otto Moerbeek Date: Tue, 19 Sep 2023 07:47:31 +0000 (+0200) Subject: rec: allow loglevel to be set to levels < 3 X-Git-Tag: rec-5.0.0-alpha2~55^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4e3713e67b867d0477c96c0f1dba5cd5d95bcfdf;p=thirdparty%2Fpdns.git rec: allow loglevel to be set to levels < 3 Fixes #13264 Also document what happens if quiet is set. --- diff --git a/pdns/recursordist/docs/settings.rst b/pdns/recursordist/docs/settings.rst index 23682e1a01..ac2dbea963 100644 --- a/pdns/recursordist/docs/settings.rst +++ b/pdns/recursordist/docs/settings.rst @@ -1229,6 +1229,9 @@ This feature is intended to facilitate ip-failover setups, but it may also mask ``loglevel`` ~~~~~~~~~~~~ +.. versionchanged:: 5.0.0 + + Previous version would not allow setting a level below ``3 (error)``. - Integer - Default: 6 @@ -1236,9 +1239,10 @@ This feature is intended to facilitate ip-failover setups, but it may also mask - YAML setting: :ref:`setting-yaml-logging.loglevel` Amount of logging. The higher the number, the more lines logged. -Corresponds to 'syslog' level values (e.g. 0 = emergency, 1 = alert, 2 = critical, 3 = error, 4 = warning, 5 = notice, 6 = info, 7 = debug). +Corresponds to ``syslog`` level values (e.g. 0 = ``emergency``, 1 = ``alert``, 2 = ``critical``, 3 = ``error``, 4 = ``warning``, 5 = ``notice``, 6 = ``info``, 7 = ``debug``). Each level includes itself plus the lower levels before it. Not recommended to set this below 3. +If :ref:`setting-quiet` is ``no/false``, :ref:`setting-loglevel` will be minimally set to ``6 (info)``. .. _setting-log-common-errors: diff --git a/pdns/recursordist/docs/yamlsettings.rst b/pdns/recursordist/docs/yamlsettings.rst index ccaa639cc3..9d82b106c2 100644 --- a/pdns/recursordist/docs/yamlsettings.rst +++ b/pdns/recursordist/docs/yamlsettings.rst @@ -1065,6 +1065,9 @@ Do not pass names like 'local0'! ``logging.loglevel`` ^^^^^^^^^^^^^^^^^^^^ +.. versionchanged:: 5.0.0 + + Previous version would not allow setting a level below ``3 (error)``. - Integer - Default: ``6`` @@ -1072,9 +1075,10 @@ Do not pass names like 'local0'! - Old style setting: :ref:`setting-loglevel` Amount of logging. The higher the number, the more lines logged. -Corresponds to 'syslog' level values (e.g. 0 = emergency, 1 = alert, 2 = critical, 3 = error, 4 = warning, 5 = notice, 6 = info, 7 = debug). +Corresponds to ``syslog`` level values (e.g. 0 = ``emergency``, 1 = ``alert``, 2 = ``critical``, 3 = ``error``, 4 = ``warning``, 5 = ``notice``, 6 = ``info``, 7 = ``debug``). Each level includes itself plus the lower levels before it. Not recommended to set this below 3. +If :ref:`setting-yaml-logging.quiet` is ``no/false``, :ref:`setting-yaml-logging.loglevel` will be minimally set to ``6 (info)``. .. _setting-yaml-logging.protobuf_use_kernel_timestamp: diff --git a/pdns/recursordist/rec-main.cc b/pdns/recursordist/rec-main.cc index 10469fb445..2769e9e2cc 100644 --- a/pdns/recursordist/rec-main.cc +++ b/pdns/recursordist/rec-main.cc @@ -3282,9 +3282,6 @@ int main(int argc, char** argv) g_slogStructured = ::arg().mustDo("structured-logging"); s_structured_logger_backend = ::arg()["structured-logging-backend"]; - if (s_logUrgency < Logger::Error) { - s_logUrgency = Logger::Error; - } if (!g_quiet && s_logUrgency < Logger::Info) { // Logger::Info=6, Logger::Debug=7 s_logUrgency = Logger::Info; // if you do --quiet=no, you need Info to also see the query log } diff --git a/pdns/recursordist/settings/table.py b/pdns/recursordist/settings/table.py index e57ea13940..127603bb1c 100644 --- a/pdns/recursordist/settings/table.py +++ b/pdns/recursordist/settings/table.py @@ -1238,11 +1238,13 @@ This feature is intended to facilitate ip-failover setups, but it may also mask 'help' : 'Amount of logging. Higher is more. Do not set below 3', 'doc' : ''' Amount of logging. The higher the number, the more lines logged. -Corresponds to 'syslog' level values (e.g. 0 = emergency, 1 = alert, 2 = critical, 3 = error, 4 = warning, 5 = notice, 6 = info, 7 = debug). +Corresponds to ``syslog`` level values (e.g. 0 = ``emergency``, 1 = ``alert``, 2 = ``critical``, 3 = ``error``, 4 = ``warning``, 5 = ``notice``, 6 = ``info``, 7 = ``debug``). Each level includes itself plus the lower levels before it. Not recommended to set this below 3. +If :ref:`setting-quiet` is ``no/false``, :ref:`setting-loglevel` will be minimally set to ``6 (info)``. ''', - }, + 'versionchanged': ('5.0.0', 'Previous version would not allow setting a level below ``3 (error)``.') + }, { 'name' : 'common_errors', 'section' : 'logging',