Querylog -- Read from querylog files when answering to /querylog API, it now survives restarts.
This commit is contained in:
@@ -88,6 +88,11 @@ func handleQueryLog(w http.ResponseWriter, r *http.Request) {
|
||||
logBufferLock.RLock()
|
||||
values := logBuffer
|
||||
logBufferLock.RUnlock()
|
||||
|
||||
if len(values) < queryLogAPI {
|
||||
values = appendFromLogFile(values, queryLogAPI, time.Hour*24)
|
||||
}
|
||||
|
||||
var data = []map[string]interface{}{}
|
||||
for _, entry := range values {
|
||||
var q *dns.Msg
|
||||
|
||||
Reference in New Issue
Block a user