From bebd43923b71b2ef4bf4e1beb5bb69ff6208d06e Mon Sep 17 00:00:00 2001 From: Simon Zolin Date: Thu, 19 Mar 2020 15:53:25 +0300 Subject: [PATCH] - querylog: querylog_memsize setting was reset to 0 Since v0.100.0 the query logs memory buffer was not active, despite the default capacity of 1000 items. Now we remove querylog_memsize setting and replace it with querylog_size_memory --- home/config.go | 6 +++--- home/home_test.go | 2 +- querylog/qlog.go | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/home/config.go b/home/config.go index cb586131..78c5dfda 100644 --- a/home/config.go +++ b/home/config.go @@ -77,9 +77,9 @@ type dnsConfig struct { // time interval for statistics (in days) StatsInterval uint32 `yaml:"statistics_interval"` - QueryLogEnabled bool `yaml:"querylog_enabled"` // if true, query log is enabled - QueryLogInterval uint32 `yaml:"querylog_interval"` // time interval for query log (in days) - QueryLogMemSize uint32 `yaml:"querylog_memsize"` // number of entries kept in memory before they are flushed to disk + QueryLogEnabled bool `yaml:"querylog_enabled"` // if true, query log is enabled + QueryLogInterval uint32 `yaml:"querylog_interval"` // time interval for query log (in days) + QueryLogMemSize uint32 `yaml:"querylog_size_memory"` // number of entries kept in memory before they are flushed to disk dnsforward.FilteringConfig `yaml:",inline"` diff --git a/home/home_test.go b/home/home_test.go index db8f4f49..8a46e493 100644 --- a/home/home_test.go +++ b/home/home_test.go @@ -28,7 +28,7 @@ dns: statistics_interval: 90 querylog_enabled: true querylog_interval: 90 - querylog_memsize: 0 + querylog_size_memory: 0 protection_enabled: true blocking_mode: null_ip blocked_response_ttl: 0 diff --git a/querylog/qlog.go b/querylog/qlog.go index 21d5a1a6..2cf1c013 100644 --- a/querylog/qlog.go +++ b/querylog/qlog.go @@ -65,6 +65,7 @@ func checkInterval(days uint32) bool { func (l *queryLog) WriteDiskConfig(dc *DiskConfig) { dc.Enabled = l.conf.Enabled dc.Interval = l.conf.Interval + dc.MemSize = l.conf.MemSize } // Clear memory buffer and remove log files