change request log format, close to nginx ones
This commit is contained in:
parent
838918da66
commit
edc6ca9b7a
4 changed files with 17 additions and 4 deletions
|
|
@ -24,7 +24,10 @@ type submissionTeamChecker struct{
|
|||
}
|
||||
|
||||
func (c submissionChecker) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
log.Printf("Handling %s %s request from %s: %s [%s]\n", r.Method, c.kind, r.RemoteAddr, r.URL.Path, r.UserAgent())
|
||||
if addr := r.Header.Get("X-Forwarded-For"); addr != "" {
|
||||
r.RemoteAddr = addr
|
||||
}
|
||||
log.Printf("%s \"%s %s\" => %s [%s]\n", r.RemoteAddr, r.Method, r.URL.Path, c.kind, r.UserAgent())
|
||||
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
|
||||
|
|
|
|||
Reference in a new issue