From 15e21689445ed8d40e58ebcfe4eb807bddabc503 Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Thu, 19 Apr 2018 07:25:30 +0100 Subject: [PATCH] Add debug logging example --- example.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/example.go b/example.go index deaba86..bf94caa 100644 --- a/example.go +++ b/example.go @@ -10,6 +10,7 @@ import ( "github.com/coredns/coredns/plugin" "github.com/coredns/coredns/plugin/metrics" + "github.com/coredns/coredns/plugin/pkg/log" "github.com/miekg/dns" "golang.org/x/net/context" @@ -28,6 +29,9 @@ func (e Example) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) // Here we wrap the dns.ResponseWriter in a new ResponseWriter and call the next plugin, when the // answer comes back, it will print "example". + // Debug log that we've have seen the query. This will only be shown when the debug plugin is loaded. + log.Debug("Received response") + // Wrap. pw := NewResponsePrinter(w)