Skip to content

Commit

Permalink
remove access log
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Archibald committed Feb 5, 2017
1 parent 929ea8a commit 47a4fa9
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions nginxauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ type nginxauth struct {
mailer mailer
cookieKey []byte
conf authConf
accessLog *os.File
errorLog *os.File
}

func main() {
Expand All @@ -87,7 +87,7 @@ func main() {
log.Fatal(err)
}
defer server.backend.Close()
defer server.accessLog.Close()
defer server.errorLog.Close()

server.serve(server.conf.AuthServerListenPort)
}
Expand Down Expand Up @@ -164,11 +164,7 @@ func (s *nginxauth) serve(port int) {
http.HandleFunc("/updateEmail", s.method("POST", updateEmail))
http.HandleFunc("/updatePassword", s.method("POST", updatePassword))

http.ListenAndServe(fmt.Sprintf(":%d", port), s.fileLoggerHandler(handlers.CompressHandler(http.DefaultServeMux)))
}

func (s *nginxauth) fileLoggerHandler(h http.Handler) http.Handler {
return handlers.CombinedLoggingHandler(s.accessLog, h)
http.ListenAndServe(fmt.Sprintf(":%d", port), handlers.CompressHandler(http.DefaultServeMux))
}

func (s *nginxauth) method(name string, handler func(authStore authStorer, w http.ResponseWriter, r *http.Request)) http.HandlerFunc {
Expand Down

0 comments on commit 47a4fa9

Please sign in to comment.