* querylog: move code to a separate package
+ config: "querylog_interval" setting /control/querylog_config, /control/querylog_info + POST /control/querylog_clear
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
|
||||
"github.com/AdguardTeam/AdGuardHome/dnsfilter"
|
||||
"github.com/AdguardTeam/AdGuardHome/dnsforward"
|
||||
"github.com/AdguardTeam/AdGuardHome/querylog"
|
||||
"github.com/AdguardTeam/AdGuardHome/stats"
|
||||
"github.com/AdguardTeam/dnsproxy/proxy"
|
||||
"github.com/AdguardTeam/dnsproxy/upstream"
|
||||
@@ -40,7 +41,12 @@ func initDNSServer(baseDir string) {
|
||||
if err != nil {
|
||||
log.Fatal("Couldn't initialize statistics module")
|
||||
}
|
||||
config.dnsServer = dnsforward.NewServer(baseDir, config.stats)
|
||||
conf := querylog.Config{
|
||||
BaseDir: baseDir,
|
||||
Interval: config.DNS.QueryLogInterval * 24,
|
||||
}
|
||||
config.queryLog = querylog.New(conf)
|
||||
config.dnsServer = dnsforward.NewServer(config.stats, config.queryLog)
|
||||
|
||||
initRDNS()
|
||||
}
|
||||
@@ -186,6 +192,7 @@ func stopDNSServer() error {
|
||||
}
|
||||
|
||||
config.stats.Close()
|
||||
config.queryLog.Close()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user