From 223fba03245d7a025a051617ff2519595bc69ead Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Mon, 9 Aug 2021 10:00:12 +0200 Subject: [PATCH] modules/bogus_log nits - use notice log level instead of error The failure is often a normal condition but we probably want it logged by default (after explicitly loading the module). - don't repeat the "dnssec" word twice in a row (+update docs) - docs bogus_log.frequent(): we format tables differently (old change) --- modules/bogus_log/README.rst | 24 +++++++++++++----------- modules/bogus_log/bogus_log.c | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/modules/bogus_log/README.rst b/modules/bogus_log/README.rst index b3ed40ee5..d60c278eb 100644 --- a/modules/bogus_log/README.rst +++ b/modules/bogus_log/README.rst @@ -5,7 +5,7 @@ DNSSEC validation failure logging ================================= -This module adds error message for each DNSSEC validation failure. +This module logs a message for each DNSSEC validation failure (on ``notice`` :func:`level `). It is meant to provide hint to operators which queries should be investigated using diagnostic tools like DNSViz_. @@ -19,7 +19,7 @@ Example of error message logged by this module: .. code-block:: none - DNSSEC validation failure dnssec-failed.org. DNSKEY + [dnssec] validation failure: dnssec-failed.org. DNSKEY .. _DNSViz: http://dnsviz.net/ @@ -28,15 +28,17 @@ List of most frequent queries which fail as DNSSEC bogus can be obtained at run- .. code-block:: lua > bogus_log.frequent() - [1] => { - [type] => DNSKEY - [count] => 1 - [name] => dnssec-failed.org. - } - [2] => { - [type] => DNSKEY - [count] => 13 - [name] => rhybar.cz. + { + { + ['count'] = 1, + ['name'] = 'dnssec-failed.org.', + ['type'] = 'DNSKEY', + }, + { + ['count'] = 13, + ['name'] = 'rhybar.cz.', + ['type'] = 'DNSKEY', + }, } Please note that in future this module might be replaced diff --git a/modules/bogus_log/bogus_log.c b/modules/bogus_log/bogus_log.c index 489879993..7b36187ef 100644 --- a/modules/bogus_log/bogus_log.c +++ b/modules/bogus_log/bogus_log.c @@ -38,7 +38,7 @@ static int consume(kr_layer_t *ctx, knot_pkt_t *pkt) auto_free char *qname_text = kr_dname_text(knot_pkt_qname(pkt)); auto_free char *qtype_text = kr_rrtype_text(knot_pkt_qtype(pkt)); - kr_log_error(DNSSEC, "DNSSEC validation failure %s %s\n", qname_text, qtype_text); + kr_log_notice(DNSSEC, "validation failure: %s %s\n", qname_text, qtype_text); /* log of most frequent bogus queries */ uint16_t type = knot_pkt_qtype(pkt); -- 2.47.2