make request logs greppable
Kubernetes-commit: e4a18dee73547e29eb1572af6da29364d64df2ab
This commit is contained in:
		
							parent
							
								
									2282d554f4
								
							
						
					
					
						commit
						09aa6a7555
					
				|  | @ -158,9 +158,17 @@ func (rl *respLogger) Log() { | |||
| 	latency := time.Since(rl.startTime) | ||||
| 	if klog.V(3) { | ||||
| 		if !rl.hijacked { | ||||
| 			klog.InfoDepth(1, fmt.Sprintf("%s %s: (%v) %v [%s %s]%v%v", rl.req.Method, rl.req.RequestURI, latency, rl.status, rl.req.UserAgent(), rl.req.RemoteAddr, rl.statusStack, rl.addedInfo)) | ||||
| 			klog.InfoDepth(1, fmt.Sprintf("verb=%q URI=%q latency=%v resp=%v UserAgent=%q srcIP=%q: %v%v", | ||||
| 				rl.req.Method, rl.req.RequestURI, | ||||
| 				latency, rl.status, | ||||
| 				rl.req.UserAgent(), rl.req.RemoteAddr, | ||||
| 				rl.statusStack, rl.addedInfo, | ||||
| 			)) | ||||
| 		} else { | ||||
| 			klog.InfoDepth(1, fmt.Sprintf("%s %s: (%v) hijacked [%s %s]", rl.req.Method, rl.req.RequestURI, latency, rl.req.UserAgent(), rl.req.RemoteAddr)) | ||||
| 			klog.InfoDepth(1, fmt.Sprintf("verb=%q URI=%q latency=%v UserAgent=%q srcIP=%q: hijacked", | ||||
| 				rl.req.Method, rl.req.RequestURI, | ||||
| 				latency, rl.req.UserAgent(), rl.req.RemoteAddr, | ||||
| 			)) | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue