add configurable log level to errors plugin (#4718)

Automatically submitted.
This commit is contained in:
Ondřej Benkovský
2021-07-09 16:23:02 +02:00
committed by GitHub
parent a6a7e73813
commit 70b51a73d3
5 changed files with 151 additions and 24 deletions

View File

@@ -22,12 +22,12 @@ Extra knobs are available with an expanded syntax:
~~~
errors {
consolidate DURATION REGEXP
consolidate DURATION REGEXP [LEVEL]
}
~~~
Option `consolidate` allows collecting several error messages matching the regular expression **REGEXP** during **DURATION**. After the **DURATION** since receiving the first such message, the consolidated message will be printed to standard output, e.g.
Option `consolidate` allows collecting several error messages matching the regular expression **REGEXP** during **DURATION**. After the **DURATION** since receiving the first such message, the consolidated message will be printed to standard output with
log level, which is configurable by optional option **LEVEL**. Supported options for **LEVEL** option are `warn`,`error`,`info` and `debug`.
~~~
2 errors like '^read udp .* i/o timeout$' occurred in last 30s
~~~
@@ -53,7 +53,7 @@ Use the *forward* to resolve queries via 8.8.8.8 and print consolidated error me
. {
forward . 8.8.8.8
errors {
consolidate 5m ".* i/o timeout$"
consolidate 5m ".* i/o timeout$" warn
consolidate 30s "^Failed to .+"
}
}