Add debug logging example
This commit is contained in:
parent
734a8a4cbb
commit
15e2168944
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user