fix(lib): add the ability to set a custom slog Logger

Closes #864
This commit is contained in:
Xe Iaso
2025-07-25 16:31:50 +00:00
parent bf42014ac3
commit 0e5f382798
5 changed files with 23 additions and 14 deletions

View File

@@ -120,11 +120,12 @@ func (s *Server) RenderIndex(w http.ResponseWriter, r *http.Request, rule *polic
return
}
lg := internal.GetRequestLogger(r)
lg := internal.GetRequestLogger(s.logger, r)
if !strings.Contains(r.Header.Get("Accept-Encoding"), "gzip") && randomChance(64) {
lg.Error("client was given a challenge but does not in fact support gzip compression")
s.respondWithError(w, r, localizer.T("client_error_browser"))
return
}
challengesIssued.WithLabelValues("embedded").Add(1)