diff --git a/main.go b/main.go index cf5a807..0c92dc1 100644 --- a/main.go +++ b/main.go @@ -81,20 +81,20 @@ func (l *Logger) Log(format string, v ...interface{}) { l.outputFile.WriteString(s) } -func (l *Logger) RequestLog(req *http.Request, userid string) string { +func (l *Logger) RequestLog(req *http.Request, userID string) string { if l.outputFile == nil { return "" } - if userid == "" { - userid = "-" + if userID == "" { + userID = "-" } var b strings.Builder b.WriteString("Request:\n") // CLF-like header ts := time.Now().Format(time.RFC3339) - fmt.Fprintf(&b, "%s %s\n", req.RemoteAddr, ts) + fmt.Fprintf(&b, "%s %s %s\n", req.RemoteAddr, userID, ts) headers := req.Header content := headers.Get("Content-Type")