plugin/log - Support for Metadata (#2251)

* - add metadata support to Log

* - adapt ctx after rebase
This commit is contained in:
Francois Tur
2018-11-13 14:20:49 -05:00
committed by John Belamaric
parent 35c5474660
commit 94c9aae323
5 changed files with 123 additions and 19 deletions

View File

@@ -57,7 +57,7 @@ func (l Logger) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg)
// If we don't set up a class in config, the default "all" will be added
// and we shouldn't have an empty rule.Class.
if rule.Class[response.All] || rule.Class[class] {
rep := replacer.New(r, rrw, CommonLogEmptyValue)
rep := replacer.New(ctx, r, rrw, CommonLogEmptyValue)
clog.Infof(rep.Replace(rule.Format))
}