mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-11-04 03:27:23 -05:00 
			
		
		
		
	Renamed {time} placeholder to {when}
This commit is contained in:
		
							parent
							
								
									24fc2ae59e
								
							
						
					
					
						commit
						822c231f1c
					
				@ -61,7 +61,7 @@ func RequestLog(p parser) Middleware {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
const (
 | 
					const (
 | 
				
			||||||
	defaultLogFilename  = "access.log"
 | 
						defaultLogFilename  = "access.log"
 | 
				
			||||||
	commonLogFormat     = `{remote} ` + emptyStringReplacer + ` [{time}] "{method} {uri} {proto}" {status} {size}`
 | 
						commonLogFormat     = `{remote} ` + emptyStringReplacer + ` [{when}] "{method} {uri} {proto}" {status} {size}`
 | 
				
			||||||
	combinedLogFormat   = commonLogFormat + ` "{>Referer}" "{>User-Agent}"`
 | 
						combinedLogFormat   = commonLogFormat + ` "{>Referer}" "{>User-Agent}"`
 | 
				
			||||||
	defaultReqLogFormat = commonLogFormat
 | 
						defaultReqLogFormat = commonLogFormat
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
				
			|||||||
@ -45,7 +45,7 @@ func newReplacer(r *http.Request, rw *responseRecorder) replacer {
 | 
				
			|||||||
			return ""
 | 
								return ""
 | 
				
			||||||
		}(),
 | 
							}(),
 | 
				
			||||||
		"{uri}": r.RequestURI,
 | 
							"{uri}": r.RequestURI,
 | 
				
			||||||
		"{time}": func() string {
 | 
							"{when}": func() string {
 | 
				
			||||||
			return time.Now().Format(timeFormat)
 | 
								return time.Now().Format(timeFormat)
 | 
				
			||||||
		}(),
 | 
							}(),
 | 
				
			||||||
		"{status}": strconv.Itoa(rw.status),
 | 
							"{status}": strconv.Itoa(rw.status),
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user