Activate insternal access logging

This commit is contained in:
Igor Chubin 2022-11-19 19:20:35 +01:00
parent d9afb06ac5
commit a8e8aa7a52

View file

@ -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)