summaryrefslogtreecommitdiffstats
path: root/roseh.moe.go
diff options
context:
space:
mode:
Diffstat (limited to 'roseh.moe.go')
-rw-r--r--roseh.moe.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/roseh.moe.go b/roseh.moe.go
index ef4e219..5f24664 100644
--- a/roseh.moe.go
+++ b/roseh.moe.go
@@ -1099,6 +1099,15 @@ func (h *timeoutHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
h.h.ServeHTTP(w, r.WithContext(ctx))
}
+type loggingHandler struct {
+ h http.Handler
+}
+
+func (h *loggingHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
+ log.Printf("%q from %q", r.Method+" "+r.Host+r.URL.String(), r.RemoteAddr)
+ h.h.ServeHTTP(w, r)
+}
+
func main() {
flag.Parse()
@@ -1204,7 +1213,7 @@ func main() {
codeMux.Handle("/", &timeoutHandler{h: cgitCGI, timeout: 5 * time.Minute})
serverMux.Handle("code."+selfURL.Hostname()+"/", &gzipHandler{codeMux})
server := &http.Server{
- Handler: serverMux,
+ Handler: &loggingHandler{serverMux},
ReadHeaderTimeout: 5 * time.Minute,
IdleTimeout: 10 * time.Minute,