You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think we can implement this by introducing a new HTTP handler skip_log (name TBD) which embeds a request matcher (not the matcher sibling to the route, but a matcher inside the handler, since we need the handler to get the match result back); when invoked, it would run the matcher and if the matcher returns true, then it would set a flag in the request's context (maybe in Vars, probably least invasive place to do it). Then later in server.go, in the defer func() that writes the access log, we can check for this skip flag to short circuit and skip emitting the log.
The text was updated successfully, but these errors were encountered:
There's demand for a way to skip certain access logs from being emitted based on request path: https://caddy.community/t/exclude-certain-requests-from-logs-based-on-request-path/15607
I think we can implement this by introducing a new HTTP handler
skip_log
(name TBD) which embeds a request matcher (not the matcher sibling to the route, but a matcher inside the handler, since we need the handler to get the match result back); when invoked, it would run the matcher and if the matcher returns true, then it would set a flag in the request's context (maybe in Vars, probably least invasive place to do it). Then later inserver.go
, in thedefer func()
that writes the access log, we can check for this skip flag to short circuit and skip emitting the log.The text was updated successfully, but these errors were encountered: