]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
modules/bogus_log nits
authorVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 9 Aug 2021 08:00:12 +0000 (10:00 +0200)
committerTomas Krizek <tomas.krizek@nic.cz>
Tue, 10 Aug 2021 18:16:59 +0000 (20:16 +0200)
- 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
modules/bogus_log/bogus_log.c

index b3ed40ee59e3c42324cbdd52f6ef92ead80e761b..d60c278ebd6087e3a588ad06092910227426877a 100644 (file)
@@ -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 <log_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
index 489879993f3ee5643379da3ed509b37efebb7be1..7b36187ef0fb438d75189569e523926341867f24 100644 (file)
@@ -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);