mirror of https://github.com/0xERR0R/blocky.git
added missing field in query log (#291)
This commit is contained in:
parent
f0a94a0e55
commit
598849efd3
|
@ -1,6 +1,8 @@
|
|||
package querylog
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/0xERR0R/blocky/log"
|
||||
"github.com/0xERR0R/blocky/util"
|
||||
"github.com/miekg/dns"
|
||||
|
@ -20,7 +22,10 @@ func NewLoggerWriter() *LoggerWriter {
|
|||
func (d *LoggerWriter) Write(entry *Entry) {
|
||||
d.logger.WithFields(
|
||||
logrus.Fields{
|
||||
"client_ip": entry.Request.ClientIP,
|
||||
"client_names": strings.Join(entry.Request.ClientNames, "; "),
|
||||
"response_reason": entry.Response.Reason,
|
||||
"question": util.QuestionToString(entry.Request.Req.Question),
|
||||
"response_code": dns.RcodeToString[entry.Response.Res.Rcode],
|
||||
"answer": util.AnswerToString(entry.Response.Res.Answer),
|
||||
"duration_ms": entry.DurationMs,
|
||||
|
|
Loading…
Reference in New Issue