- Gitea version (or commit ref): 1.13.1
- Git version: 2.26.2
- Operating system: Official Docker image; gitea/gitea:1.13.1
- Database (use
[x]):
- Can you reproduce the bug at https://try.gitea.io:
- Log gist:
[Macaron] 2021-01-12 10:00:58: Started GET for xxx.xxx.xxx.xxx
[Macaron] [Static] Serving /serviceworker.js
[Macaron] 2021-01-12 10:00:58: Completed GET 304 Not Modified in 479.996µs
[Macaron] 2021-01-12 10:00:58: Completed GET 304 Not Modified in 479.996µs
[Macaron] 2021-01-12 10:00:58: Started GET for xxx.xxx.xxx.xxx
[Macaron] 2021-01-12 10:00:58: Started GET for xxx.xxx.xxx.xxx
[Macaron] 2021-01-12 10:00:58: Completed GET 200 OK in 3.775066ms
[Macaron] 2021-01-12 10:00:58: Completed GET 200 OK in 3.775066ms
Description
When using PROTOCOL = fcgi, request paths(http.Request.RequestURI) are not shown in the logs.
Go's net/http/cgi.RequestFromMap(), which net/http/fcgi uses, does not populate RequestURI(but does URL). As RequestURI is documented "Usually the URL field should be used instead", req.URL.RequestURI() may be a simple and recommended alternative.
|
_ = log.GetLogger("router").Log(0, level, "Started %s %s for %s", log.ColoredMethod(req.Method), req.RequestURI, req.RemoteAddr) |
|
_ = log.GetLogger("router").Log(0, level, "Completed %s %s %v %s in %v", log.ColoredMethod(req.Method), req.RequestURI, log.ColoredStatus(status), log.ColoredStatus(status, http.StatusText(status)), log.ColoredTime(time.Since(start))) |
Screenshots
None
[x]):Description
When using
PROTOCOL = fcgi, request paths(http.Request.RequestURI) are not shown in the logs.Go's
net/http/cgi.RequestFromMap(), whichnet/http/fcgiuses, does not populateRequestURI(but doesURL). AsRequestURIis documented "Usually the URL field should be used instead",req.URL.RequestURI()may be a simple and recommended alternative.gitea/routers/routes/chi.go
Line 89 in 9659808
gitea/routers/routes/chi.go
Line 96 in 9659808
Screenshots
None