From a8e8aa7a52a42431c6cb4a2bf673b0518204391c Mon Sep 17 00:00:00 2001 From: Igor Chubin Date: Sat, 19 Nov 2022 19:20:35 +0100 Subject: [PATCH] Activate insternal access logging --- cmd/srv.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmd/srv.go b/cmd/srv.go index e289d77..94e41b8 100644 --- a/cmd/srv.go +++ b/cmd/srv.go @@ -73,7 +73,14 @@ func copyHeader(dst, src http.Header) { } func main() { + logger := NewRequestLogger( + Conf.Logging.AccessLog, + time.Duration(Conf.Logging.Interval)*time.Second) + http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + if err := logger.Log(r); err != nil { + log.Println(err) + } // printStat() response := processRequest(r)