From 575908ae51010b2d71c0b1d4bf4def997bea0fa3 Mon Sep 17 00:00:00 2001 From: Igor Chubin Date: Fri, 5 Jan 2024 22:00:57 +0100 Subject: [PATCH] Do not log 127.0.0.1 queries --- internal/logging/logging.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/logging/logging.go b/internal/logging/logging.go index 992c479..467b4f1 100644 --- a/internal/logging/logging.go +++ b/internal/logging/logging.go @@ -56,6 +56,11 @@ func (rl *RequestLogger) Log(r *http.Request) error { le.Proto = "https" } + // Do not log 127.0.0.1 connections + if le.IP == "127.0.0.1" { + return nil + } + rl.m.Lock() rl.buf[le]++ rl.m.Unlock()