trace: Add source IP in verbose mode (#3612)

Add the source IP information in the REQUEST trace line when the verbose
mode is enabled.
This commit is contained in:
Anis Elleuch
2021-02-12 21:32:08 -08:00
committed by GitHub
parent 006cb0c0cf
commit d759f195f2
+1 -1
View File
@@ -395,7 +395,7 @@ func (t traceMessage) String() string {
ri := trc.ReqInfo
rs := trc.RespInfo
fmt.Fprintf(b, "%s%s", nodeNameStr, console.Colorize("Request", fmt.Sprintf("[REQUEST %s] ", trc.FuncName)))
fmt.Fprintf(b, "%s\n", ri.Time.Format(timeFormat))
fmt.Fprintf(b, "[%s] %s\n", ri.Time.Format(timeFormat), console.Colorize("Host", fmt.Sprintf("[Client IP: %s]", ri.Client)))
fmt.Fprintf(b, "%s%s", nodeNameStr, console.Colorize("Method", fmt.Sprintf("%s %s", ri.Method, ri.Path)))
if ri.RawQuery != "" {
fmt.Fprintf(b, "?%s", ri.RawQuery)