Fix logging: add response_bytes to middleware, cache_key to handler

- Middleware now tracks and logs bytes written via response_bytes
- Handler logs cache_key for cache hit debugging
- Changed "served encrypted image" to "image served" (only URL is encrypted)
This commit is contained in:
2026-01-08 13:05:10 -08:00
parent e5135b3697
commit 9bfae69ccf
2 changed files with 13 additions and 3 deletions

View File

@@ -91,7 +91,8 @@ func (s *Handlers) HandleImageEnc() http.HandlerFunc {
// Log completion
duration := time.Since(start)
s.log.Info("served encrypted image",
s.log.Info("image served",
"cache_key", imgcache.CacheKey(req),
"host", req.SourceHost,
"path", req.SourcePath,
"format", req.Format,