mirror of
https://github.com/coredns/coredns.git
synced 2026-10-09 03:55:21 -04:00
Add opt-in JSON logging with structured DNS query fields (#8553)
* plugin/pkg/log: add opt-in JSON logging backend Signed-off-by: houyuwushang <liuluoqianqiu@outlook.com> * plugin/log: emit typed query records in JSON mode Signed-off-by: houyuwushang <liuluoqianqiu@outlook.com> * coremain: expose process-wide JSON logging Signed-off-by: houyuwushang <liuluoqianqiu@outlook.com> --------- Signed-off-by: houyuwushang <liuluoqianqiu@outlook.com>
This commit is contained in:
@@ -21,7 +21,6 @@ func msg() *dns.Msg {
|
||||
}
|
||||
|
||||
func TestNoDebug(t *testing.T) {
|
||||
// Must come first, because set log.D.Set() which is impossible to undo.
|
||||
var f bytes.Buffer
|
||||
golog.SetOutput(&f)
|
||||
|
||||
@@ -45,6 +44,7 @@ func ExampleHexdump() {
|
||||
}
|
||||
|
||||
func TestHexdump(t *testing.T) {
|
||||
t.Cleanup(log.D.Clear)
|
||||
var f bytes.Buffer
|
||||
golog.SetOutput(&f)
|
||||
log.D.Set()
|
||||
@@ -59,6 +59,7 @@ func TestHexdump(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestHexdumpf(t *testing.T) {
|
||||
t.Cleanup(log.D.Clear)
|
||||
var f bytes.Buffer
|
||||
golog.SetOutput(&f)
|
||||
log.D.Set()
|
||||
|
||||
Reference in New Issue
Block a user