diff options
| author | Rose Hogenson <rosehogenson@posteo.net> | 2026-09-26 09:08:36 -0700 |
|---|---|---|
| committer | Rose Hogenson <rosehogenson@posteo.net> | 2026-09-26 09:09:57 -0700 |
| commit | 2f6c0fbb2c49cad041a596f5f75200e6cc055ea0 (patch) | |
| tree | dcc4a76f5b6d55c5ba06048052f0a980d118729d | |
| parent | Increase cookie expiry (diff) | |
| download | roseh.moe-2f6c0fbb2c49cad041a596f5f75200e6cc055ea0.tar.zst | |
Add back logging again
| -rw-r--r-- | roseh.moe.go | 11 |
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, |
