Activate insternal access logging

chubin/logging
Igor Chubin 2 years ago
parent d9afb06ac5
commit a8e8aa7a52

@ -73,7 +73,14 @@ func copyHeader(dst, src http.Header) {
} }
func main() { func main() {
logger := NewRequestLogger(
Conf.Logging.AccessLog,
time.Duration(Conf.Logging.Interval)*time.Second)
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
if err := logger.Log(r); err != nil {
log.Println(err)
}
// printStat() // printStat()
response := processRequest(r) response := processRequest(r)

Loading…
Cancel
Save