Add http request scheme to logger
This commit is contained in:
parent
7c430e5c9d
commit
1c764052f7
5 changed files with 71 additions and 3 deletions
|
@ -193,6 +193,11 @@ func (h *Handler) ServeHTTP(rw http.ResponseWriter, req *http.Request, next http
|
|||
core[RequestPath] = urlCopyString
|
||||
core[RequestProtocol] = req.Proto
|
||||
|
||||
core[RequestScheme] = "http"
|
||||
if req.TLS != nil {
|
||||
core[RequestScheme] = "https"
|
||||
}
|
||||
|
||||
core[ClientAddr] = req.RemoteAddr
|
||||
core[ClientHost], core[ClientPort] = silentSplitHostPort(req.RemoteAddr)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue