MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / logRequestLine

Method logRequestLine

rest/handler.go:750–770  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

748}
749
750func (h *handler) logRequestLine() {
751
752 logLevel := base.LevelInfo
753 if h.httpLogLevel != nil {
754 logLevel = *h.httpLogLevel
755 }
756
757 // Check Log Level first, as SanitizeRequestURL is expensive to evaluate.
758 if !base.LogLevelEnabled(h.ctx(), logLevel, base.KeyHTTP) {
759 return
760 }
761
762 proto := ""
763 if h.rq.ProtoMajor >= 2 {
764 proto = " HTTP/2"
765 }
766
767 queryValues := h.getQueryValues()
768
769 base.LogLevelCtx(h.ctx(), logLevel, base.KeyHTTP, "%s %s%s%s", h.rq.Method, base.SanitizeRequestURL(h.rq, &queryValues), proto, h.formattedEffectiveUserName())
770}
771
772// shouldUpdateBytesTransferredStats returns true if we want to log the bytes transferred. The criteria is if this is db scoped over the public port. Blip is skipped since those stats are tracked separately.
773func (h *handler) shouldUpdateBytesTransferredStats() bool {

Callers 2

wrapRouterFunction · 0.80

Calls 6

ctxMethod · 0.95
getQueryValuesMethod · 0.95
LogLevelEnabledFunction · 0.92
LogLevelCtxFunction · 0.92
SanitizeRequestURLFunction · 0.92

Tested by

no test coverage detected